clippy fix

This commit is contained in:
Kogia-sima 2020-12-18 19:18:52 +09:00
parent bf55dd7909
commit f98ed7426f
4 changed files with 7 additions and 11 deletions

View File

@ -26,7 +26,7 @@ impl Default for Config {
} }
#[cfg(feature = "config")] #[cfg(feature = "config")]
mod config { mod imp {
use std::fs; use std::fs;
use yaml_rust::yaml::{Yaml, YamlLoader}; use yaml_rust::yaml::{Yaml, YamlLoader};

View File

@ -73,12 +73,7 @@ impl<'h> ResolverImpl<'h> {
PathBuf::from(&arg[1..]) PathBuf::from(&arg[1..])
} else { } else {
// relative include // relative include
self.path_stack self.path_stack.last().unwrap().parent().unwrap().join(arg)
.last()
.unwrap()
.parent()
.unwrap()
.join(arg.clone())
}; };
// parse and translate the child template // parse and translate the child template

View File

@ -149,7 +149,7 @@ impl SourceBuilder {
fn write_code<'a>(&mut self, token: &Token<'a>) -> Result<(), Error> { fn write_code<'a>(&mut self, token: &Token<'a>) -> Result<(), Error> {
// TODO: automatically add missing tokens (e.g. ';', '{') // TODO: automatically add missing tokens (e.g. ';', '{')
self.write_token(token); self.write_token(token);
self.source.push_str("\n"); self.source.push('\n');
Ok(()) Ok(())
} }
@ -197,7 +197,7 @@ impl SourceBuilder {
self.source.push_str("sailfish::runtime::filter::"); self.source.push_str("sailfish::runtime::filter::");
self.source.push_str(&*name); self.source.push_str(&*name);
self.source.push_str("("); self.source.push('(');
// arguments to filter function // arguments to filter function
{ {
@ -209,7 +209,7 @@ impl SourceBuilder {
}; };
self.source_map.entries.push(entry); self.source_map.entries.push(entry);
self.source.push_str(&expr_str); self.source.push_str(&expr_str);
self.source.push_str(")"); self.source.push(')');
if let Some(extra_args) = extra_args { if let Some(extra_args) = extra_args {
self.source.push_str(", "); self.source.push_str(", ");
@ -217,7 +217,7 @@ impl SourceBuilder {
} }
} }
self.source.push_str(")"); self.source.push(')');
} else { } else {
self.write_token(token); self.write_token(token);
} }

View File

@ -33,6 +33,7 @@
)] )]
#![cfg_attr(sailfish_nightly, feature(core_intrinsics))] #![cfg_attr(sailfish_nightly, feature(core_intrinsics))]
#![cfg_attr(docsrs, feature(doc_cfg))] #![cfg_attr(docsrs, feature(doc_cfg))]
#![allow(clippy::redundant_closure)]
pub mod runtime; pub mod runtime;