Skip to content

Commit

Permalink
Clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
langyo committed Mar 28, 2024
1 parent 0b5bb9e commit e9429db
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/yew-router/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub(crate) fn strip_slash_suffix(path: &str) -> &str {

static BASE_URL_LOADED: std::sync::Once = std::sync::Once::new();
thread_local! {
static BASE_URL: RefCell<Option<String>> = RefCell::new(None);
static BASE_URL: RefCell<Option<String>> = const { RefCell::new(None) };
}

// This exists so we can cache the base url. It costs us a `to_string` call instead of a DOM API
Expand Down
2 changes: 1 addition & 1 deletion packages/yew/src/renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::app_handle::AppHandle;
use crate::html::BaseComponent;

thread_local! {
static PANIC_HOOK_IS_SET: Cell<bool> = Cell::new(false);
static PANIC_HOOK_IS_SET: Cell<bool> = const { Cell::new(false) };
}

/// Set a custom panic hook.
Expand Down
1 change: 1 addition & 0 deletions packages/yew/src/virtual_dom/vlist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ impl Deref for VList {
// This is mutable because the Vec<VNode> is not Sync
static mut EMPTY: Vec<VNode> = Vec::new();
// SAFETY: The EMPTY value is always read-only
#[allow(static_mut_refs)]
unsafe { &EMPTY }
}
}
Expand Down

0 comments on commit e9429db

Please sign in to comment.