Clippy + 1.63

This commit is contained in:
Vincent Prouillet 2023-01-09 21:59:08 +01:00 committed by Vincent Prouillet
parent e12b766e2c
commit 608837cddf
6 changed files with 10 additions and 10 deletions

View file

@ -21,7 +21,7 @@ stages:
rustup_toolchain: stable
linux-pinned:
imageName: 'ubuntu-20.04'
rustup_toolchain: 1.61.0
rustup_toolchain: 1.63.0
pool:
vmImage: $(imageName)
steps:

View file

@ -211,7 +211,7 @@ impl<'a> Paginator<'a> {
} else {
format!("{}{}/", self.permalink, self.paginate_path)
};
paginator.insert("base_url", to_value(&base_url).unwrap());
paginator.insert("base_url", to_value(base_url).unwrap());
paginator.insert("pages", to_value(&current_pager.pages).unwrap());
paginator.insert("current_index", to_value(current_pager.index).unwrap());
paginator.insert("total_pages", to_value(self.all_pages.len()).unwrap());

View file

@ -174,8 +174,8 @@ impl Site {
let mut allowed_index_filenames: Vec<_> = self
.config
.other_languages()
.iter()
.map(|(code, _)| format!("_index.{}.md", code))
.keys()
.map(|code| format!("_index.{}.md", code))
.collect();
allowed_index_filenames.push("_index.md".to_string());
@ -796,11 +796,11 @@ impl Site {
)?;
let (path, content) = match &self.config.search.index_format {
IndexFormat::ElasticlunrJson => {
let path = self.output_path.join(&format!("search_index.{}.json", lang));
let path = self.output_path.join(format!("search_index.{}.json", lang));
(path, index_json)
}
IndexFormat::ElasticlunrJavascript => {
let path = self.output_path.join(&format!("search_index.{}.js", lang));
let path = self.output_path.join(format!("search_index.{}.js", lang));
let content = format!("window.searchIndex = {};", index_json);
(path, content)
}

View file

@ -62,7 +62,7 @@ pub fn base64_encode<S: BuildHasher>(
_: &HashMap<String, Value, S>,
) -> TeraResult<Value> {
let s = try_get_value!("base64_encode", "value", String, value);
Ok(to_value(&encode(s.as_bytes())).unwrap())
Ok(to_value(encode(s.as_bytes())).unwrap())
}
pub fn base64_decode<S: BuildHasher>(
@ -70,7 +70,7 @@ pub fn base64_decode<S: BuildHasher>(
_: &HashMap<String, Value, S>,
) -> TeraResult<Value> {
let s = try_get_value!("base64_decode", "value", String, value);
Ok(to_value(&String::from_utf8(decode(s.as_bytes()).unwrap()).unwrap()).unwrap())
Ok(to_value(String::from_utf8(decode(s.as_bytes()).unwrap()).unwrap()).unwrap())
}
#[derive(Debug)]

View file

@ -125,7 +125,7 @@ impl TeraFn for GetUrl {
&self.output_path,
)
.map_err(|e| format!("`get_url`: {}", e))?
.and_then(|(p, _)| fs::File::open(&p).ok())
.and_then(|(p, _)| fs::File::open(p).ok())
.and_then(|mut f| {
let mut contents = String::new();

View file

@ -127,7 +127,7 @@ impl TeraFn for GetImageMetadata {
return Ok(cached_result.clone());
}
let response = imageproc::read_image_metadata(&src_path)
let response = imageproc::read_image_metadata(src_path)
.map_err(|e| format!("`resize_image`: {}", e))?;
let out = to_value(response).unwrap();
cache.insert(unified_path, out.clone());