Skip to content

Commit a317539

Browse files
committed
Make fields of Atom private
atom!() macros create values through a `const fn` constructor
1 parent 2e1d42a commit a317539

File tree

10 files changed

+92
-338
lines changed

10 files changed

+92
-338
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ lazy_static = "1"
2222
serde = "1"
2323
phf_shared = "0.8"
2424
new_debug_unreachable = "1.0"
25-
string_cache_shared = {path = "./shared", version = "0.3"}
2625

2726
[[test]]
2827
name = "small-stack"

integration-tests/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,14 @@ macro_rules! assert_eq_fmt (($fmt:expr, $x:expr, $y:expr) => ({
157157
#[test]
158158
fn repr() {
159159
fn check(s: &str, data: u64) {
160-
assert_eq_fmt!("0x{:016X}", Atom::from(s).unsafe_data, data);
160+
assert_eq_fmt!("0x{:016X}", Atom::from(s).unsafe_data(), data);
161161
}
162162

163163
fn check_static(s: &str, x: Atom) {
164-
assert_eq_fmt!("0x{:016X}", x.unsafe_data, Atom::from(s).unsafe_data);
165-
assert_eq!(0x2, x.unsafe_data & 0xFFFF_FFFF);
164+
assert_eq_fmt!("0x{:016X}", x.unsafe_data(), Atom::from(s).unsafe_data());
165+
assert_eq!(0x2, x.unsafe_data() & 0xFFFF_FFFF);
166166
// The index is unspecified by phf.
167-
assert!((x.unsafe_data >> 32) <= TestAtomStaticSet::get().atoms.len() as u64);
167+
assert!((x.unsafe_data() >> 32) <= TestAtomStaticSet::get().atoms.len() as u64);
168168
}
169169

170170
// This test is here to make sure we don't change atom representation
@@ -182,7 +182,7 @@ fn repr() {
182182
check("xyzzy01", 0x3130_797A_7A79_7871);
183183

184184
// Dynamic atoms. This is a pointer so we can't verify every bit.
185-
assert_eq!(0x00, Atom::from("a dynamic string").unsafe_data & 0xf);
185+
assert_eq!(0x00, Atom::from("a dynamic string").unsafe_data() & 0xf);
186186
}
187187

188188
#[test]

shared/Cargo.toml

Lines changed: 0 additions & 11 deletions
This file was deleted.

shared/LICENSE-APACHE

Lines changed: 0 additions & 201 deletions
This file was deleted.

shared/LICENSE-MIT

Lines changed: 0 additions & 25 deletions
This file was deleted.

shared/lib.rs

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)