From b838154c8c33eb9ca0c6c067694ec2b55b7cd24d Mon Sep 17 00:00:00 2001 From: Shunsuke Shibayama Date: Sat, 18 Nov 2023 16:11:22 +0900 Subject: [PATCH] fix: eliminate warns --- crates/erg_common/error.rs | 2 +- crates/erg_common/traits.rs | 2 +- crates/erg_compiler/link_hir.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/erg_common/error.rs b/crates/erg_common/error.rs index 23818a5a6..fbf705872 100644 --- a/crates/erg_common/error.rs +++ b/crates/erg_common/error.rs @@ -373,7 +373,7 @@ impl Ord for Location { } impl PartialOrd for Location { - #[allow(clippy::incorrect_partial_ord_impl_on_ord_type)] + #[allow(clippy::non_canonical_partial_ord_impl)] fn partial_cmp(&self, other: &Location) -> Option { if self.is_unknown() || other.is_unknown() { None diff --git a/crates/erg_common/traits.rs b/crates/erg_common/traits.rs index 2e4d2df65..40427518a 100644 --- a/crates/erg_common/traits.rs +++ b/crates/erg_common/traits.rs @@ -769,7 +769,7 @@ pub trait Runnable: Sized + Default + New { let indent = vm.indent(); if vm.now_block.len() > 1 { output.write_all(instance.ps2().as_bytes()).unwrap(); - output.write_all(indent.as_str().as_bytes()).unwrap(); + output.write_all(indent.as_bytes()).unwrap(); output.flush().unwrap(); } else { output.write_all(instance.ps1().as_bytes()).unwrap(); diff --git a/crates/erg_compiler/link_hir.rs b/crates/erg_compiler/link_hir.rs index 441bedbac..84866ac8f 100644 --- a/crates/erg_compiler/link_hir.rs +++ b/crates/erg_compiler/link_hir.rs @@ -491,7 +491,7 @@ impl<'a> HIRLinker<'a> { if !mod_path .canonicalize() .unwrap() - .starts_with(&dir.canonicalize().unwrap()) + .starts_with(dir.canonicalize().unwrap()) { dir = PathBuf::new(); }