Skip to content

Commit 3d8f520

Browse files
author
bors-servo
authored
Auto merge of #222 - Eijebong:syn-1.0, r=jdm
Update syn related dependencies to 1.0 and bump version <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/string-cache/222) <!-- Reviewable:end -->
2 parents b417081 + 904fb63 commit 3d8f520

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

src/atom.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ impl<Static: StaticAtomSet> Serialize for Atom<Static> {
450450

451451
impl<'a, Static: StaticAtomSet> Deserialize<'a> for Atom<Static> {
452452
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where D: Deserializer<'a> {
453-
let string: String = try!(Deserialize::deserialize(deserializer));
453+
let string: String = Deserialize::deserialize(deserializer)?;
454454
Ok(Atom::from(string))
455455
}
456456
}
@@ -460,7 +460,9 @@ impl<'a, Static: StaticAtomSet> Deserialize<'a> for Atom<Static> {
460460
// over the one from &str.
461461
impl<Static: StaticAtomSet> Atom<Static> {
462462
fn from_mutated_str<F: FnOnce(&mut str)>(s: &str, f: F) -> Self {
463-
let mut buffer: [u8; 64] = unsafe { mem::uninitialized() };
463+
let mut buffer = mem::MaybeUninit::<[u8; 64]>::uninit();
464+
let buffer = unsafe { &mut *buffer.as_mut_ptr() };
465+
464466
if let Some(buffer_prefix) = buffer.get_mut(..s.len()) {
465467
buffer_prefix.copy_from_slice(s.as_bytes());
466468
let as_str = unsafe { ::std::str::from_utf8_unchecked_mut(buffer_prefix) };

string-cache-codegen/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22

33
name = "string_cache_codegen"
4-
version = "0.4.3" # Also update ../README.md when making a semver-breaking change
4+
version = "0.4.4" # Also update ../README.md when making a semver-breaking change
55
authors = [ "The Servo Project Developers" ]
66
description = "A codegen library for string-cache, developed as part of the Servo project."
77
license = "MIT / Apache-2.0"
@@ -16,5 +16,5 @@ path = "lib.rs"
1616
string_cache_shared = {path = "../shared", version = "0.3"}
1717
phf_generator = "0.7.15"
1818
phf_shared = "0.7.4"
19-
proc-macro2 = "0.4"
20-
quote = "0.6"
19+
proc-macro2 = "1"
20+
quote = "1"

string-cache-codegen/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,6 @@ impl AtomType {
269269
/// Typical usage:
270270
/// `.write_to_file(&Path::new(&env::var("OUT_DIR").unwrap()).join("foo_atom.rs"))`
271271
pub fn write_to_file(&mut self, path: &Path) -> io::Result<()> {
272-
self.write_to(BufWriter::new(try!(File::create(path))))
272+
self.write_to(BufWriter::new(File::create(path)?))
273273
}
274274
}

0 commit comments

Comments
 (0)