1
1
mirror of https://github.com/tweag/nickel.git synced 2024-08-16 15:10:25 +03:00

Fix clippy 1.75 warnings (#1750)

This commit is contained in:
Yann Hamdaoui 2024-01-07 17:32:34 +00:00 committed by GitHub
parent 77b9c5791a
commit 25cba8c21e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 2 deletions

View File

@ -102,7 +102,7 @@ impl DocCommand {
let mut has_file_name = false;
if let Some(path) = self.input.files.get(0) {
if let Some(path) = self.input.files.first() {
if let Some(file_stem) = path.file_stem() {
output_file.push(file_stem);
has_file_name = true;

View File

@ -106,6 +106,10 @@ impl TermEnvironment for SimpleTermEnvironment {
where
F: FnOnce(Option<(&RichTerm, &SimpleTermEnvironment)>) -> T,
{
// See https://github.com/rust-lang/rust-clippy/issues/11764. It's been fixed upstream, but
// hasn't landed in a clippy release yet. We can remove the allow(clippy) once it does
// land.
#[allow(clippy::map_identity)]
f(env.0.get(&id).map(|(rt, env)| (rt, env)))
}

View File

@ -2106,7 +2106,7 @@ fn infer_with_annot<V: TypecheckVisitor>(
},
value_opt,
) if !contracts.is_empty() => {
let ctr = contracts.get(0).unwrap();
let ctr = contracts.first().unwrap();
let LabeledType { typ: ty2, .. } = ctr;
let uty2 = UnifType::from_type(ty2.clone(), &ctxt.term_env);