mirror of
https://github.com/getzola/zola
synced 2024-09-20 06:11:54 +00:00
Clippy + 1.63
This commit is contained in:
parent
e12b766e2c
commit
608837cddf
6 changed files with 10 additions and 10 deletions
|
@ -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:
|
||||
|
|
|
@ -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(¤t_pager.pages).unwrap());
|
||||
paginator.insert("current_index", to_value(current_pager.index).unwrap());
|
||||
paginator.insert("total_pages", to_value(self.all_pages.len()).unwrap());
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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)]
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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());
|
||||
|
|
Loading…
Reference in a new issue