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> {
450
450
451
451
impl < ' a , Static : StaticAtomSet > Deserialize < ' a > for Atom < Static > {
452
452
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) ? ;
454
454
Ok ( Atom :: from ( string) )
455
455
}
456
456
}
@@ -460,7 +460,9 @@ impl<'a, Static: StaticAtomSet> Deserialize<'a> for Atom<Static> {
460
460
// over the one from &str.
461
461
impl < Static : StaticAtomSet > Atom < Static > {
462
462
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
+
464
466
if let Some ( buffer_prefix) = buffer. get_mut ( ..s. len ( ) ) {
465
467
buffer_prefix. copy_from_slice ( s. as_bytes ( ) ) ;
466
468
let as_str = unsafe { :: std:: str:: from_utf8_unchecked_mut ( buffer_prefix) } ;
Original file line number Diff line number Diff line change 1
1
[package ]
2
2
3
3
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
5
5
authors = [ " The Servo Project Developers" ]
6
6
description = " A codegen library for string-cache, developed as part of the Servo project."
7
7
license = " MIT / Apache-2.0"
@@ -16,5 +16,5 @@ path = "lib.rs"
16
16
string_cache_shared = {path = " ../shared" , version = " 0.3" }
17
17
phf_generator = " 0.7.15"
18
18
phf_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 {
269
269
/// Typical usage:
270
270
/// `.write_to_file(&Path::new(&env::var("OUT_DIR").unwrap()).join("foo_atom.rs"))`
271
271
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) ? ) )
273
273
}
274
274
}
You can’t perform that action at this time.
0 commit comments