Reduce allocations (#30693)

Removes a unnecessary string conversion and some clones

Release Notes:

- N/A
This commit is contained in:
tidely
2025-05-14 18:29:28 +02:00
committed by GitHub
parent fcfe4e2c14
commit bc99a86bb7
17 changed files with 48 additions and 57 deletions
+2 -2
View File
@@ -942,8 +942,8 @@ impl MentionLink {
format!("[@{}]({}:{})", title, Self::THREAD, id)
}
ThreadContextEntry::Context { path, title } => {
let filename = path.file_name().unwrap_or_default();
let escaped_filename = urlencoding::encode(&filename.to_string_lossy()).to_string();
let filename = path.file_name().unwrap_or_default().to_string_lossy();
let escaped_filename = urlencoding::encode(&filename);
format!(
"[@{}]({}:{}{})",
title,