diff options
| author | Mark Rousskov <mark.simulacrum@gmail.com> | 2022-02-22 18:05:51 -0500 |
|---|---|---|
| committer | Mark Rousskov <mark.simulacrum@gmail.com> | 2022-02-22 18:05:51 -0500 |
| commit | da3b2ca95636eea18c62089bae5e7443ecf94c9a (patch) | |
| tree | 60ca2ea3edb6c9ce602cd6a8ec721e1f96bc5e12 /compiler/rustc_serialize/src/serialize.rs | |
| parent | 68369a041cea809a87e5bd80701da90e0e0a4799 (diff) | |
| download | rust-da3b2ca95636eea18c62089bae5e7443ecf94c9a.tar.gz rust-da3b2ca95636eea18c62089bae5e7443ecf94c9a.zip | |
Provide raw &str access from Decoder
Diffstat (limited to 'compiler/rustc_serialize/src/serialize.rs')
| -rw-r--r-- | compiler/rustc_serialize/src/serialize.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_serialize/src/serialize.rs b/compiler/rustc_serialize/src/serialize.rs index a012be2857e..fbbd13657ba 100644 --- a/compiler/rustc_serialize/src/serialize.rs +++ b/compiler/rustc_serialize/src/serialize.rs @@ -198,7 +198,7 @@ pub trait Decoder { fn read_f64(&mut self) -> f64; fn read_f32(&mut self) -> f32; fn read_char(&mut self) -> char; - fn read_str(&mut self) -> Cow<'_, str>; + fn read_str(&mut self) -> &str; fn read_raw_bytes_into(&mut self, s: &mut [u8]); } @@ -313,7 +313,7 @@ impl<S: Encoder> Encodable<S> for String { impl<D: Decoder> Decodable<D> for String { fn decode(d: &mut D) -> String { - d.read_str().into_owned() + d.read_str().to_owned() } } |
