fix: resolve clippy warnings and test errors
- Implement FromStr trait for NodeType instead of custom from_str method - Fix redundant_closure warning in server.rs:455 - Add #[allow(clippy::too_many_arguments)] for new_file_node - Fix unused variables in tests (_user_id, _conn) - Remove unused imports (NodeType, serde_json::json) - Replace len() > 0 with !is_empty() for clarity - Replace == false with negation operator - Format code with cargo fmt
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
use markbase::filetree::node::NodeType;
|
||||
use markbase::filetree::{mode, FileTree};
|
||||
use rusqlite::Connection;
|
||||
use uuid::Uuid;
|
||||
@@ -102,7 +101,7 @@ fn test_mode_sort_options() {
|
||||
let mode = mode::get_mode("list").unwrap();
|
||||
let sort_options = mode.sort_options();
|
||||
|
||||
assert!(sort_options.len() > 0, "sort options should not be empty");
|
||||
assert!(!sort_options.is_empty(), "sort options should not be empty");
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -111,7 +110,7 @@ fn test_mode_filter_options() {
|
||||
let filter_options = mode.filter_options();
|
||||
|
||||
assert!(
|
||||
filter_options.len() > 0,
|
||||
!filter_options.is_empty(),
|
||||
"filter options should not be empty"
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user