fix(clippy): use more efficient cloning
This commit is contained in:
parent
7c664fd6e2
commit
513caa0033
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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(())
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue