mirror of
https://github.com/getzola/zola
synced 2024-11-10 06:14:19 +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
|
rustup_toolchain: stable
|
||||||
linux-pinned:
|
linux-pinned:
|
||||||
imageName: 'ubuntu-20.04'
|
imageName: 'ubuntu-20.04'
|
||||||
rustup_toolchain: 1.61.0
|
rustup_toolchain: 1.63.0
|
||||||
pool:
|
pool:
|
||||||
vmImage: $(imageName)
|
vmImage: $(imageName)
|
||||||
steps:
|
steps:
|
||||||
|
|
|
@ -211,7 +211,7 @@ impl<'a> Paginator<'a> {
|
||||||
} else {
|
} else {
|
||||||
format!("{}{}/", self.permalink, self.paginate_path)
|
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("pages", to_value(¤t_pager.pages).unwrap());
|
||||||
paginator.insert("current_index", to_value(current_pager.index).unwrap());
|
paginator.insert("current_index", to_value(current_pager.index).unwrap());
|
||||||
paginator.insert("total_pages", to_value(self.all_pages.len()).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
|
let mut allowed_index_filenames: Vec<_> = self
|
||||||
.config
|
.config
|
||||||
.other_languages()
|
.other_languages()
|
||||||
.iter()
|
.keys()
|
||||||
.map(|(code, _)| format!("_index.{}.md", code))
|
.map(|code| format!("_index.{}.md", code))
|
||||||
.collect();
|
.collect();
|
||||||
allowed_index_filenames.push("_index.md".to_string());
|
allowed_index_filenames.push("_index.md".to_string());
|
||||||
|
|
||||||
|
@ -796,11 +796,11 @@ impl Site {
|
||||||
)?;
|
)?;
|
||||||
let (path, content) = match &self.config.search.index_format {
|
let (path, content) = match &self.config.search.index_format {
|
||||||
IndexFormat::ElasticlunrJson => {
|
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)
|
(path, index_json)
|
||||||
}
|
}
|
||||||
IndexFormat::ElasticlunrJavascript => {
|
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);
|
let content = format!("window.searchIndex = {};", index_json);
|
||||||
(path, content)
|
(path, content)
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,7 @@ pub fn base64_encode<S: BuildHasher>(
|
||||||
_: &HashMap<String, Value, S>,
|
_: &HashMap<String, Value, S>,
|
||||||
) -> TeraResult<Value> {
|
) -> TeraResult<Value> {
|
||||||
let s = try_get_value!("base64_encode", "value", String, 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>(
|
pub fn base64_decode<S: BuildHasher>(
|
||||||
|
@ -70,7 +70,7 @@ pub fn base64_decode<S: BuildHasher>(
|
||||||
_: &HashMap<String, Value, S>,
|
_: &HashMap<String, Value, S>,
|
||||||
) -> TeraResult<Value> {
|
) -> TeraResult<Value> {
|
||||||
let s = try_get_value!("base64_decode", "value", String, 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)]
|
#[derive(Debug)]
|
||||||
|
|
|
@ -125,7 +125,7 @@ impl TeraFn for GetUrl {
|
||||||
&self.output_path,
|
&self.output_path,
|
||||||
)
|
)
|
||||||
.map_err(|e| format!("`get_url`: {}", e))?
|
.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| {
|
.and_then(|mut f| {
|
||||||
let mut contents = String::new();
|
let mut contents = String::new();
|
||||||
|
|
||||||
|
|
|
@ -127,7 +127,7 @@ impl TeraFn for GetImageMetadata {
|
||||||
return Ok(cached_result.clone());
|
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))?;
|
.map_err(|e| format!("`resize_image`: {}", e))?;
|
||||||
let out = to_value(response).unwrap();
|
let out = to_value(response).unwrap();
|
||||||
cache.insert(unified_path, out.clone());
|
cache.insert(unified_path, out.clone());
|
||||||
|
|
Loading…
Reference in a new issue