Skip to content

Commit

Permalink
Fix nightly clippy lints.
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnavion committed Jan 17, 2024
1 parent 00a7829 commit 5edc0ee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions k8s-openapi-codegen/src/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub(crate) struct Logger;
impl log::Log for Logger {
fn enabled(&self, metadata: &log::Metadata<'_>) -> bool {
TASK_LOCAL_LOGGER.try_with(|logger| logger.enabled(metadata)).unwrap_or_else(|_|
THREAD_LOCAL_LOGGER.with(|thread_local_logger| thread_local_logger.borrow().as_ref().map(|logger| logger.enabled(metadata)).unwrap_or_default()))
THREAD_LOCAL_LOGGER.with(|thread_local_logger| thread_local_logger.borrow().as_ref().is_some_and(|logger| logger.enabled(metadata))))
}

fn log(&self, record: &log::Record<'_>) {
Expand All @@ -36,5 +36,5 @@ pub(crate) fn register_thread_local_logger(logger: env_logger::Logger) {
}

thread_local! {
static THREAD_LOCAL_LOGGER: std::cell::RefCell<Option<env_logger::Logger>> = std::cell::RefCell::new(None);
static THREAD_LOCAL_LOGGER: std::cell::RefCell<Option<env_logger::Logger>> = const { std::cell::RefCell::new(None) };
}

0 comments on commit 5edc0ee

Please sign in to comment.