Skip to content

Commit

Permalink
fix: resolve lint errors from latest nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
sunng87 committed Mar 8, 2024
1 parent 40824c6 commit e7d6341
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/helpers/block_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pub(crate) fn create_block<'rc>(param: &PathAndJson<'rc>) -> BlockContext<'rc> {
let mut block = BlockContext::new();

if let Some(new_path) = param.context_path() {
*block.base_path_mut() = new_path.clone();
block.base_path_mut().clone_from(new_path)
} else {
// use clone for now
block.set_base_value(param.value().clone());
Expand Down
4 changes: 2 additions & 2 deletions src/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ impl Renderable for Template {
}

if e.template_name.is_none() {
e.template_name = self.name.clone();
e.template_name.clone_from(&self.name);
}

e
Expand Down Expand Up @@ -715,7 +715,7 @@ impl Evaluable for Template {
}
}

e.template_name = self.name.clone();
e.template_name.clone_from(&self.name);
e
})?;
}
Expand Down
8 changes: 4 additions & 4 deletions src/template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ impl Template {
fn remove_previous_whitespace(template_stack: &mut VecDeque<Template>) {
let t = template_stack.front_mut().unwrap();
if let Some(RawString(ref mut text)) = t.elements.last_mut() {
*text = text.trim_end().to_owned();
text.trim_end().to_owned().clone_into(text);
}
}

Expand Down Expand Up @@ -566,9 +566,9 @@ impl Template {
// check the last element before current
if let Some(RawString(ref mut text)) = t.elements.last_mut() {
// trim leading space for standalone statement
*text = text
.trim_end_matches(support::str::whitespace_matcher)
.to_owned();
text.trim_end_matches(support::str::whitespace_matcher)
.to_owned()
.clone_into(text);
}
}

Expand Down

0 comments on commit e7d6341

Please sign in to comment.