Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Keats committed Feb 16, 2023
1 parent 8ba6c1c commit 9f490bf
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 37 deletions.
66 changes: 33 additions & 33 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion components/content/src/front_matter/page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ impl PageFrontMatter {

f.date_to_datetime();

for (_, terms) in &f.taxonomies {
for terms in f.taxonomies.values() {
for term in terms {
if term.trim().is_empty() {
bail!("A taxonomy term cannot be an empty string");
Expand Down
4 changes: 1 addition & 3 deletions components/templates/src/global_fns/files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use config::Config;
use libs::base64::engine::{general_purpose::STANDARD as standard_b64, Engine};
use libs::sha2::{digest, Sha256, Sha384, Sha512};
use libs::tera::{from_value, to_value, Function as TeraFn, Result, Value};
use libs::url;
use utils::site::resolve_internal_link;

fn compute_hash<D: digest::Digest>(literal: String, as_base64: bool) -> String
Expand Down Expand Up @@ -135,8 +134,7 @@ impl TeraFn for GetUrl {
Some(compute_hash::<Sha256>(contents, false))
}) {
Some(hash) => {
let fullhash = format!("{}", hash);
let shorthash = &fullhash[..20]; // 2^-80 chance of false positive
let shorthash = &hash[..20]; // 2^-80 chance of false positive
permalink = format!("{}?h={}", permalink, shorthash);
}
None => {
Expand Down

0 comments on commit 9f490bf

Please sign in to comment.