Browse Source

fix clippy

Evan Almloff 1 year ago
parent
commit
9f729dd6de

+ 1 - 1
packages/cli/src/builder.rs

@@ -312,7 +312,7 @@ pub fn build_desktop(config: &CrateConfig, _is_serve: bool) -> Result<BuildResul
     if !config.out_dir.is_dir() {
         create_dir_all(&config.out_dir)?;
     }
-    copy(res_path, &config.out_dir.join(target_file))?;
+    copy(res_path, config.out_dir.join(target_file))?;
 
     // this code will copy all public file to the output dir
     if config.asset_dir.is_dir() {

+ 0 - 1
packages/hooks/src/use_callback.rs

@@ -25,7 +25,6 @@ macro_rules! use_callback {
     };
 }
 
-#[must_use]
 pub fn use_callback<T, R, F>(cx: &ScopeState, make: impl FnOnce() -> R) -> impl FnMut(T) + '_
 where
     R: FnMut(T) -> F + 'static,

+ 0 - 1
packages/hooks/src/use_future.rs

@@ -17,7 +17,6 @@ use crate::{use_state, UseState};
 /// will be canceled before the new one is started.
 ///
 /// - dependencies: a tuple of references to values that are PartialEq + Clone
-#[must_use = "Consider using `cx.spawn` to run a future without reading its value"]
 pub fn use_future<T, F, D>(
     cx: &ScopeState,
     dependencies: D,

+ 1 - 1
packages/server-macro/src/lib.rs

@@ -109,7 +109,7 @@ pub fn server(args: proc_macro::TokenStream, s: TokenStream) -> TokenStream {
         let upper_cammel_case_name = Converter::new()
             .from_case(Case::Snake)
             .to_case(Case::UpperCamel)
-            .convert(&sig.ident.to_string());
+            .convert(sig.ident.to_string());
         args.struct_name = Some(Ident::new(&upper_cammel_case_name, sig.ident.span()));
     }
     let struct_name = args.struct_name.as_ref().unwrap();