Skip to content

Commit

Permalink
Fix clippy 1.75 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
yannham committed Jan 5, 2024
1 parent 88ca23c commit ea867a3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cli/src/doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions core/src/typecheck/eq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
}

Expand Down
2 changes: 1 addition & 1 deletion core/src/typecheck/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ea867a3

Please sign in to comment.