Skip to content

Commit

Permalink
fix: resolve latest lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sunng87 committed Dec 5, 2022
1 parent 95e1895 commit 4760425
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ fn main() {
.unwrap();
match handlebars.render(&filename, &data) {
Ok(data) => {
println!("{}", data);
println!("{data}");
}
Err(e) => {
println!("Error rendering {}: {}", filename, e);
println!("Error rendering {filename}: {e}");
process::exit(2);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ fn template_segment(template_str: &str, line: usize, col: usize) -> String {
let mut buf = String::new();
for (line_count, line_content) in template_str.lines().enumerate() {
if line_count >= line_start && line_count <= line_end {
let _ = writeln!(&mut buf, "{:4} | {}", line_count, line_content);
let _ = writeln!(&mut buf, "{line_count:4} | {line_content}");
if line_count == line - 1 {
buf.push_str(" |");
for c in 0..line_content.len() {
Expand Down
2 changes: 1 addition & 1 deletion src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ impl<'reg> Registry<'reg> {
if let Some(result) = self.get_or_load_template_optional(name) {
result
} else {
Err(RenderError::new(format!("Template not found: {}", name)))
Err(RenderError::new(format!("Template not found: {name}")))
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ impl Parameter {
if let Some(name) = self.as_name() {
name.to_owned()
} else {
format!("{:?}", self)
format!("{self:?}")
}
}
}
Expand Down

0 comments on commit 4760425

Please sign in to comment.