Skip to content

Commit

Permalink
CrateData: don't allocate String when Serialize, &str is enough
Browse files Browse the repository at this point in the history
  • Loading branch information
klensy committed Jan 13, 2023
1 parent ffb2e84 commit 8998bd3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustdoc/html/render/search_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;
Expand Down

0 comments on commit 8998bd3

Please sign in to comment.