Skip to content

Commit

Permalink
chore: make clippy happy (#336)
Browse files Browse the repository at this point in the history
  • Loading branch information
knopp committed Mar 25, 2024
1 parent b949a1a commit 7ff5daa
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions super_native_extensions/rust/src/android/data_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ static DATA_PROVIDERS: Lazy<Mutex<HashMap<i64, DataProviderRecord>>> =
Lazy::new(|| Mutex::new(HashMap::new()));

thread_local! {
static NEXT_ID: Cell<i64> = Cell::new(1);
static NEXT_ID: Cell<i64> = const { Cell::new(1) };
}

pub struct PlatformDataProvider {
Expand Down Expand Up @@ -285,7 +285,7 @@ impl PlatformDataProvider {
let providers: Vec<_> = providers.into_iter().map(|p| p.0).collect();

thread_local! {
static CURRENT_CLIP: RefCell<Vec<Arc<DataProviderHandle>>> = RefCell::new(Vec::new());
static CURRENT_CLIP: RefCell<Vec<Arc<DataProviderHandle>>> = const { RefCell::new(Vec::new()) };
}
// ClipManager doesn't provide any lifetime management for clip so just
// keep the data awake until the clip is replaced.
Expand Down
2 changes: 1 addition & 1 deletion super_native_extensions/rust/src/android/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ impl PlatformDataReader {
}

thread_local! {
static NEXT_HANDLE: Cell<i64> = Cell::new(1);
static NEXT_HANDLE: Cell<i64> = const { Cell::new(1) };
static PENDING:
RefCell<HashMap<i64,irondash_run_loop::util::FutureCompleter<NativeExtensionsResult<Value>>>> = RefCell::new(HashMap::new());
}
Expand Down
4 changes: 2 additions & 2 deletions super_native_extensions/rust/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ impl Context {
}

thread_local! {
static CURRENT_CONTEXT: RefCell<Option<Context>> = RefCell::new(None);
static CURRENT_CONTEXT_FALLBACK: RefCell<Option<Context>> = RefCell::new(None);
static CURRENT_CONTEXT: RefCell<Option<Context>> = const { RefCell::new(None) };
static CURRENT_CONTEXT_FALLBACK: RefCell<Option<Context>> = const { RefCell::new(None) };
}

impl Drop for Context {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ impl DataProviderSession {
fn new_stream_handle_for_storage(storage: VirtualFileStorage) -> Option<i32> {
fn next_stream_entry_handle() -> i32 {
thread_local! {
static NEXT_STREAM_ENTRY_HANDLE : Cell<i32> = Cell::new(0)
static NEXT_STREAM_ENTRY_HANDLE : Cell<i32> = const { Cell::new(0) }
}
NEXT_STREAM_ENTRY_HANDLE.with(|handle| {
let res = handle.get();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub struct PlatformDataProvider {
}

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

impl PlatformDataProvider {
Expand Down
1 change: 1 addition & 0 deletions super_native_extensions/rust/src/data_provider_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ impl VirtualSessionHandle {
}

/// Keeps the data provider alive
#[allow(unused)] // DropNotifier is not read but needs to be retained.
pub struct DataProviderHandle(DropNotifier);

impl From<DropNotifier> for DataProviderHandle {
Expand Down
2 changes: 1 addition & 1 deletion super_native_extensions/rust/src/win32/data_object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ impl DataObject {
}

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

impl DataObject {
Expand Down
2 changes: 1 addition & 1 deletion super_native_extensions/rust/src/win32/data_provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ static STREAM_ENTRIES: Lazy<Mutex<HashMap<i32, SegmentedQueueWriter>>> =
pub(super) fn add_stream_entry(writer: SegmentedQueueWriter) -> i32 {
fn next_stream_entry_handle() -> i32 {
thread_local! {
static NEXT_STREAM_ENTRY_HANDLE : Cell<i32> = Cell::new(0)
static NEXT_STREAM_ENTRY_HANDLE : Cell<i32> = const { Cell::new(0) }
}
NEXT_STREAM_ENTRY_HANDLE.with(|handle| {
let res = handle.get();
Expand Down

0 comments on commit 7ff5daa

Please sign in to comment.