Remove some unnecessary borrows
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user