diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7183c290..288735a9 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -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: diff --git a/components/content/src/pagination.rs b/components/content/src/pagination.rs index 12135142..b1680d22 100644 --- a/components/content/src/pagination.rs +++ b/components/content/src/pagination.rs @@ -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()); diff --git a/components/site/src/lib.rs b/components/site/src/lib.rs index f25b6af8..03d301a2 100644 --- a/components/site/src/lib.rs +++ b/components/site/src/lib.rs @@ -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) } diff --git a/components/templates/src/filters.rs b/components/templates/src/filters.rs index 4360b46a..b5df4705 100644 --- a/components/templates/src/filters.rs +++ b/components/templates/src/filters.rs @@ -62,7 +62,7 @@ pub fn base64_encode( _: &HashMap, ) -> TeraResult { 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( @@ -70,7 +70,7 @@ pub fn base64_decode( _: &HashMap, ) -> TeraResult { 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)] diff --git a/components/templates/src/global_fns/files.rs b/components/templates/src/global_fns/files.rs index 00ddaa28..313f0098 100644 --- a/components/templates/src/global_fns/files.rs +++ b/components/templates/src/global_fns/files.rs @@ -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(); diff --git a/components/templates/src/global_fns/images.rs b/components/templates/src/global_fns/images.rs index e9aad501..c1983f22 100644 --- a/components/templates/src/global_fns/images.rs +++ b/components/templates/src/global_fns/images.rs @@ -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());