Skip to content

Commit 8998bd3

Browse files
committed
CrateData: don't allocate String when Serialize, &str is enough
1 parent ffb2e84 commit 8998bd3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustdoc/html/render/search_index.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ pub(crate) fn build_index<'tcx>(
299299
)?;
300300
crate_data.serialize_field(
301301
"p",
302-
&self.paths.iter().map(|(it, s)| (it, s.to_string())).collect::<Vec<_>>(),
302+
&self.paths.iter().map(|(it, s)| (it, s.as_str())).collect::<Vec<_>>(),
303303
)?;
304304
if has_aliases {
305305
crate_data.serialize_field("a", &self.aliases)?;

0 commit comments

Comments
 (0)