File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed
Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -450,7 +450,7 @@ impl<Static: StaticAtomSet> Serialize for Atom<Static> {
450450
451451impl < ' 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.
461461impl < 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) } ;
Original file line number Diff line number Diff line change 11[package ]
22
33name = " 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
55authors = [ " The Servo Project Developers" ]
66description = " A codegen library for string-cache, developed as part of the Servo project."
77license = " MIT / Apache-2.0"
@@ -16,5 +16,5 @@ path = "lib.rs"
1616string_cache_shared = {path = " ../shared" , version = " 0.3" }
1717phf_generator = " 0.7.15"
1818phf_shared = " 0.7.4"
19- proc-macro2 = " 0.4 "
20- quote = " 0.6 "
19+ proc-macro2 = " 1 "
20+ quote = " 1 "
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments