Skip to content

Commit

Permalink
Make Clippy happy
Browse files Browse the repository at this point in the history
  • Loading branch information
smoelius committed Jan 14, 2024
1 parent ba8967d commit df00811
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
7 changes: 5 additions & 2 deletions core/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,10 @@ fn past_removals_init_lazy(context: &LightContext) -> Result<Vec<Removal>> {

thread_local! {
#[allow(clippy::type_complexity)]
static SQLITE_AND_PAST_REMOVALS: OnceCell<(Rc<RefCell<Option<sqlite::Sqlite>>>, Rc<RefCell<Vec<Removal>>>)> = OnceCell::new();
static SQLITE_AND_PAST_REMOVALS: OnceCell<(
Rc<RefCell<Option<sqlite::Sqlite>>>,
Rc<RefCell<Vec<Removal>>>,
)> = const { OnceCell::new() };
}

#[allow(clippy::type_complexity)]
Expand Down Expand Up @@ -663,7 +666,7 @@ fn sqlite_and_past_removals_init_lazy(
))
}
})
.map(Clone::clone)
.cloned()
})
}

Expand Down
2 changes: 1 addition & 1 deletion core/src/source_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use std::{
};

thread_local! {
static ROOT: RefCell<Option<Rc<PathBuf>>> = RefCell::new(None);
static ROOT: RefCell<Option<Rc<PathBuf>>> = const { RefCell::new(None) };
static SOURCE_FILES: RefCell<HashMap<PathBuf, SourceFile>> = RefCell::new(HashMap::new());
}

Expand Down
3 changes: 3 additions & 0 deletions frameworks/src/ts/mocha/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ impl<'ast, T> Clone for SourceMapped<'ast, T> {
impl<'ast, T> Copy for SourceMapped<'ast, T> {}

impl<'ast, T: PartialEq> PartialEq for SourceMapped<'ast, T> {
// smoelius: Remove this `#[allow(..)]` once the following pull request appears in nightly:
// https://github.com/rust-lang/rust-clippy/pull/12137
#[allow(clippy::unconditional_recursion)]
fn eq(&self, other: &Self) -> bool {
self.node.eq(other.node)
}
Expand Down

0 comments on commit df00811

Please sign in to comment.