CrateData: don't allocate String when Serialize, &str is enough
This commit is contained in:
parent
ffb2e84319
commit
8998bd35ed
@ -299,7 +299,7 @@ pub(crate) fn build_index<'tcx>(
|
||||
)?;
|
||||
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)?;
|
||||
|
Loading…
x
Reference in New Issue
Block a user