Remove some unnecessary borrows

This commit is contained in:
Nick Groenen 2024-08-04 11:59:17 +02:00
parent c32d70ac06
commit fc7ebd111a
No known key found for this signature in database
GPG Key ID: 4F0AD019928AE098
2 changed files with 3 additions and 3 deletions

View File

@ -378,7 +378,7 @@ impl<'a> Exporter<'a> {
.filter(|file| file.starts_with(&self.start_at)) .filter(|file| file.starts_with(&self.start_at))
.try_for_each(|file| { .try_for_each(|file| {
let relative_path = file let relative_path = file
.strip_prefix(&self.start_at.clone()) .strip_prefix(self.start_at.clone())
.expect("file should always be nested under root") .expect("file should always be nested under root")
.to_path_buf(); .to_path_buf();
let destination = &self.destination.join(relative_path); let destination = &self.destination.join(relative_path);

View File

@ -203,7 +203,7 @@ fn test_embed_postprocessors_context() {
} }
let is_root_note = ctx let is_root_note = ctx
.frontmatter .frontmatter
.get(&Value::String("is_root_note".into())) .get(Value::String("is_root_note".into()))
.unwrap(); .unwrap();
if is_root_note != &Value::Bool(true) { if is_root_note != &Value::Bool(true) {
// NOTE: Test failure may not give output consistently because the test binary // NOTE: Test failure may not give output consistently because the test binary
@ -220,7 +220,7 @@ fn test_embed_postprocessors_context() {
exporter.add_embed_postprocessor(&|ctx, _mdevents| { exporter.add_embed_postprocessor(&|ctx, _mdevents| {
let is_root_note = ctx let is_root_note = ctx
.frontmatter .frontmatter
.get(&Value::String("is_root_note".into())) .get(Value::String("is_root_note".into()))
.unwrap(); .unwrap();
if is_root_note == &Value::Bool(true) { if is_root_note == &Value::Bool(true) {
// NOTE: Test failure may not give output consistently because the test binary // NOTE: Test failure may not give output consistently because the test binary