mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-30 04:56:25 +03:00
CrateData: don't allocate String when Serialize, &str is enough
This commit is contained in:
@@ -299,7 +299,7 @@ fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
||||
)?;
|
||||
crate_data.serialize_field(
|
||||
"p",
|
||||
&self.paths.iter().map(|(it, s)| (it, s.to_string())).collect::<Vec<_>>(),
|
||||
&self.paths.iter().map(|(it, s)| (it, s.as_str())).collect::<Vec<_>>(),
|
||||
)?;
|
||||
if has_aliases {
|
||||
crate_data.serialize_field("a", &self.aliases)?;
|
||||
|
||||
Reference in New Issue
Block a user