diff options
| author | Marek Barvíř <barvirm@gmail.com> | 2023-04-01 15:53:13 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-01 15:53:13 +0200 |
| commit | 5e5b1bba510179a1c50f34b3a239f1913e7be78d (patch) | |
| tree | 520058fd817fcd4b5f3e523c5f665fed6916b098 /library/src/meta | |
| parent | 9eb6174b22fa4824869fc5e923b96847c2968462 (diff) | |
Needless clone, borrows, casts and lifetimes (#504)
Diffstat (limited to 'library/src/meta')
| -rw-r--r-- | library/src/meta/bibliography.rs | 6 | ||||
| -rw-r--r-- | library/src/meta/outline.rs | 2 | ||||
| -rw-r--r-- | library/src/meta/reference.rs | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/library/src/meta/bibliography.rs b/library/src/meta/bibliography.rs index ac2dea75..19126291 100644 --- a/library/src/meta/bibliography.rs +++ b/library/src/meta/bibliography.rs @@ -52,7 +52,7 @@ pub struct BibliographyElem { args.expect::<Spanned<BibPaths>>("path to bibliography file")?; for path in &mut paths.0 { // resolve paths - *path = vm.locate(&path).at(span)?.to_string_lossy().into(); + *path = vm.locate(path).at(span)?.to_string_lossy().into(); } // check that parsing works let _ = load(vm.world(), &paths).at(span)?; @@ -145,7 +145,7 @@ impl Show for BibliographyElem { let mut seq = vec![]; if let Some(title) = self.title(styles) { - let title = title.clone().unwrap_or_else(|| { + let title = title.unwrap_or_else(|| { TextElem::packed(self.local_name(TextElem::lang_in(styles))) .spanned(self.span()) }); @@ -526,7 +526,7 @@ fn create( // Make link from citation to here work. let backlink = { let mut content = Content::empty(); - content.set_location(ref_location(&reference.entry)); + content.set_location(ref_location(reference.entry)); MetaElem::set_data(vec![Meta::Elem(content)]) }; diff --git a/library/src/meta/outline.rs b/library/src/meta/outline.rs index dbf879c3..33b6b70a 100644 --- a/library/src/meta/outline.rs +++ b/library/src/meta/outline.rs @@ -73,7 +73,7 @@ impl Show for OutlineElem { fn show(&self, vt: &mut Vt, styles: StyleChain) -> SourceResult<Content> { let mut seq = vec![ParbreakElem::new().pack()]; if let Some(title) = self.title(styles) { - let title = title.clone().unwrap_or_else(|| { + let title = title.unwrap_or_else(|| { TextElem::packed(self.local_name(TextElem::lang_in(styles))) .spanned(self.span()) }); diff --git a/library/src/meta/reference.rs b/library/src/meta/reference.rs index 0b317db0..24687845 100644 --- a/library/src/meta/reference.rs +++ b/library/src/meta/reference.rs @@ -119,7 +119,7 @@ impl Show for RefElem { .map(TextElem::packed) .unwrap_or_default(), Smart::Custom(None) => Content::empty(), - Smart::Custom(Some(Supplement::Content(content))) => content.clone(), + Smart::Custom(Some(Supplement::Content(content))) => content, Smart::Custom(Some(Supplement::Func(func))) => { func.call_vt(vt, [elem.clone().into()])?.display() } |
