Skip to content

Commit 19cb599

Browse files
committed
ref: cargo clippy
1 parent 5209e6c commit 19cb599

6 files changed

Lines changed: 8 additions & 10 deletions

File tree

crates/cli/src/analyser/data_type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ impl Analyser {
4747
));
4848
}
4949

50-
if dt.r#type == "" {
50+
if dt.r#type.is_empty() {
5151
self.reporter.add(Diagnose::new(
5252
dt.identifier.clone(),
5353
adt.original_definition.clone(),

crates/cli/src/analyser/flow_type.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ impl Analyser {
7777
));
7878
}
7979

80-
if &flow.signature == "" {
80+
if flow.signature.is_empty() {
8181
self.reporter.add(Diagnose::new(
8282
name.clone(),
8383
original.clone(),

crates/cli/src/analyser/function.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ impl Analyser {
7878
));
7979
}
8080

81-
if function.signature == "" {
81+
if function.signature.is_empty() {
8282
self.reporter.add(Diagnose::new(
8383
name.clone(),
8484
original.clone(),

crates/cli/src/command/search_module.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ pub fn search_module(name: Option<String>, path: Option<String>) {
102102
.map(|x| x.into_module())
103103
.collect();
104104

105-
let summary = summary_table(&mods);
105+
let summary = summary_table(mods);
106106
success_table(summary);
107107

108108
success(format!(

crates/cli/src/command/watch.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,15 @@ pub async fn watch_for_changes(path: Option<String>, with_warning: bool) {
3939
last_run = Instant::now();
4040
}
4141
}
42-
EventKind::Remove(_) => {
43-
if last_run.elapsed() > Duration::from_millis(500) {
42+
EventKind::Remove(_)
43+
if last_run.elapsed() > Duration::from_millis(500) => {
4444
default(String::from(
4545
"\n\n\n--------------------------------------------------------------------------\n\n",
4646
));
4747
info(String::from("Change detected! Regenerating report..."));
4848
Analyser::new(dir_path.as_str()).report(false, with_warning);
4949
last_run = Instant::now();
5050
}
51-
}
5251
_ => {}
5352
}
5453
}

crates/cli/src/reader.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,14 @@ impl Reader {
108108

109109
// Handle direct module definition file.
110110
let module_definition_file = module_path.join("module.json");
111-
if module_definition_file.is_file() {
112-
if let Ok(meta_result) = Meta::read_from_file(
111+
if module_definition_file.is_file()
112+
&& let Ok(meta_result) = Meta::read_from_file(
113113
module_name.clone(),
114114
MetaType::ModuleDefinition,
115115
module_definition_file,
116116
) {
117117
result.push(meta_result);
118118
}
119-
}
120119

121120
// Handle all typed definition directories.
122121
let type_entries = match fs::read_dir(&module_path) {

0 commit comments

Comments
 (0)