Skip to content

Commit b43c682

Browse files
committed
Avoid manually calling to_owned and rely on the visitor contract instead.
1 parent 17b64ef commit b43c682

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

Cargo.lock

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ authors = ["Adam Reichold <[email protected]>"]
77
license = "MIT OR Apache-2.0"
88
repository = "https://github.com/adamreichold/serde-mincode"
99
documentation = "https://docs.rs/serde-mincode"
10-
version = "0.1.3"
10+
version = "0.1.4"
1111
edition = "2021"
1212

1313
[dependencies]

src/de.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ impl<'de> serde::de::Deserializer<'de> for &mut Decoder<'de> {
147147
{
148148
let bytes = self.decode_bytes()?;
149149

150-
visitor.visit_byte_buf(bytes.to_owned())
150+
visitor.visit_bytes(bytes)
151151
}
152152

153153
fn deserialize_str<V>(self, visitor: V) -> Result<V::Value, Self::Error>
@@ -173,7 +173,7 @@ impl<'de> serde::de::Deserializer<'de> for &mut Decoder<'de> {
173173
return Error::InvalidStr.into();
174174
};
175175

176-
visitor.visit_string(value.to_owned())
176+
visitor.visit_str(value)
177177
}
178178

179179
fn deserialize_unit<V>(self, visitor: V) -> Result<V::Value, Self::Error>

0 commit comments

Comments
 (0)