瀏覽代碼

chore: fix clippy warnings and tests

Lucas Nogueira 3 年之前
父節點
當前提交
645b5a8b8a
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      core/tauri/src/endpoints/file_system.rs
  2. 1 1
      core/tauri/src/scope/mod.rs

+ 1 - 1
core/tauri/src/endpoints/file_system.rs

@@ -380,7 +380,7 @@ mod tests {
   #[tauri_macros::module_command_test(fs_read_file, "fs > readFile")]
   #[quickcheck_macros::quickcheck]
   fn read_file(path: SafePathBuf, options: Option<FileOperationOptions>) {
-    let res = super::Cmd::read_text_file(crate::test::mock_invoke_context(), path, options);
+    let res = super::Cmd::read_file(crate::test::mock_invoke_context(), path, options);
     assert!(!matches!(res, Err(crate::Error::ApiNotAllowlisted(_))));
   }
 

+ 1 - 1
core/tauri/src/scope/mod.rs

@@ -36,7 +36,7 @@ impl ExecuteArgs {
   pub fn is_empty(&self) -> bool {
     match self {
       Self::None => true,
-      Self::Single(s) if s == "" => true,
+      Self::Single(s) if s.is_empty() => true,
       Self::List(l) => l.is_empty(),
       Self::Map(m) => m.is_empty(),
       _ => false,