fix(clippy): use more efficient cloning

This commit is contained in:
winstxnhdw 2024-06-27 16:16:01 +08:00
parent 7c664fd6e2
commit 513caa0033
No known key found for this signature in database
GPG Key ID: 28C6693A1379DAE9
4 changed files with 9 additions and 9 deletions

View File

@ -263,7 +263,7 @@ impl Document {
tried_src_path = true;
if let Some(s) = t.to_str() {
name = s.to_owned();
s.clone_into(&mut name);
}
}
@ -273,7 +273,7 @@ impl Document {
if let Some(Component::Normal(t)) = full_path.components().next_back() {
if let Some(s) = t.to_str() {
name = s.to_owned();
s.clone_into(&mut name);
}
}
}

View File

@ -197,13 +197,13 @@ impl FontEnsemble {
// Update the info records for the relevant fonts to capture the
// established relationship.
self.font_files[regular].family_name = name.clone();
self.font_files[regular].family_name.clone_from(&name);
self.font_files[regular].family_relation = FamilyRelativeFontId::Regular;
self.font_files[bold].family_name = name.clone();
self.font_files[bold].family_name.clone_from(&name);
self.font_files[bold].family_relation = FamilyRelativeFontId::Bold;
self.font_files[italic].family_name = name.clone();
self.font_files[italic].family_name.clone_from(&name);
self.font_files[italic].family_relation = FamilyRelativeFontId::Italic;
self.font_files[bold_italic].family_name = name.clone();
self.font_files[bold_italic].family_name.clone_from(&name);
self.font_files[bold_italic].family_relation = FamilyRelativeFontId::BoldItalic;
self.font_families.insert(

View File

@ -167,12 +167,12 @@ impl InitializationState {
}
fn handle_set_template(&mut self, texpath: &str, _common: &mut Common) -> Result<()> {
self.next_template_path = texpath.to_owned();
texpath.clone_into(&mut self.next_template_path);
Ok(())
}
fn handle_set_output_path(&mut self, texpath: &str, _common: &mut Common) -> Result<()> {
self.next_output_path = texpath.to_owned();
texpath.clone_into(&mut self.next_output_path);
Ok(())
}

View File

@ -1132,7 +1132,7 @@ impl ProcessingSessionBuilder {
}
};
filesystem_root = parent.clone();
filesystem_root.clone_from(&parent);
let pio: Box<dyn IoProvider> = Box::new(FilesystemPrimaryInputIo::new(&p));
(pio, Some(p), parent)
}