瀏覽代碼

fix some clippy lints

Evan Almloff 1 年之前
父節點
當前提交
356497df4e
共有 3 個文件被更改,包括 8 次插入3 次删除
  1. 6 1
      packages/cli-config/src/config.rs
  2. 1 1
      packages/core/src/runtime.rs
  3. 1 1
      packages/generational-box/src/unsync.rs

+ 6 - 1
packages/cli-config/src/config.rs

@@ -392,7 +392,12 @@ impl CrateConfig {
                 None => manifest
                 None => manifest
                     .bin
                     .bin
                     .iter()
                     .iter()
-                    .find(|b| b.name == manifest.package.as_ref().map(|pkg| pkg.name.clone()))
+                    .find(|b| {
+                        #[allow(clippy::useless_asref)]
+                        let matching_bin =
+                            b.name == manifest.package.as_ref().map(|pkg| pkg.name.clone());
+                        matching_bin
+                    })
                     .or(manifest
                     .or(manifest
                         .bin
                         .bin
                         .iter()
                         .iter()

+ 1 - 1
packages/core/src/runtime.rs

@@ -11,7 +11,7 @@ use std::{
 };
 };
 
 
 thread_local! {
 thread_local! {
-    static RUNTIMES: RefCell<Vec<Rc<Runtime>>> = RefCell::new(vec![]);
+    static RUNTIMES: RefCell<Vec<Rc<Runtime>>> = const { RefCell::new(vec![]) };
 }
 }
 
 
 /// A global runtime that is shared across all scopes that provides the async runtime and context API
 /// A global runtime that is shared across all scopes that provides the async runtime and context API

+ 1 - 1
packages/generational-box/src/unsync.rs

@@ -85,7 +85,7 @@ impl<T: 'static> Storage<T> for UnsyncStorage {
 }
 }
 
 
 thread_local! {
 thread_local! {
-    static UNSYNC_RUNTIME: RefCell<Vec<MemoryLocation<UnsyncStorage>>> = RefCell::new(Vec::new());
+    static UNSYNC_RUNTIME: RefCell<Vec<MemoryLocation<UnsyncStorage>>> = const { RefCell::new(Vec::new()) };
 }
 }
 
 
 impl AnyStorage for UnsyncStorage {
 impl AnyStorage for UnsyncStorage {