Skip to content

Commit ba516aa

Browse files
committed
ref: cargo clippy
1 parent 5aad62b commit ba516aa

File tree

4 files changed

+10
-15
lines changed

4 files changed

+10
-15
lines changed

crates/cli/src/analyser/flow_type.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ impl Analyser {
3636
));
3737
}
3838

39-
if let Some(identifier) = &flow.input_type_identifier {
40-
if !self.data_type_identifier_exists(identifier, None) {
39+
if let Some(identifier) = &flow.input_type_identifier
40+
&& !self.data_type_identifier_exists(identifier, None) {
4141
self.reporter.add(Diagnose::new(
4242
name.clone(),
4343
original.clone(),
@@ -46,9 +46,8 @@ impl Analyser {
4646
},
4747
));
4848
}
49-
}
50-
if let Some(identifier) = &flow.return_type_identifier {
51-
if !self.data_type_identifier_exists(identifier, None) {
49+
if let Some(identifier) = &flow.return_type_identifier
50+
&& !self.data_type_identifier_exists(identifier, None) {
5251
self.reporter.add(Diagnose::new(
5352
name.clone(),
5453
original.clone(),
@@ -57,7 +56,6 @@ impl Analyser {
5756
},
5857
));
5958
}
60-
}
6159

6260
for setting in &flow.settings {
6361
if setting.name.is_empty() {

crates/cli/src/command/search.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ fn search_and_display_definitions(search_name: &str, parser: &Parser) {
3535
let mut index = 0;
3636
for line in json.lines() {
3737
index += 1;
38-
println!("{} {}", format!("{index}:"), line.bright_cyan());
38+
println!("{}: {}", index, line.bright_cyan());
3939
}
4040
}
4141
Err(_) => println!("{}", "Error serializing FlowType".red()),
@@ -57,7 +57,7 @@ fn search_and_display_definitions(search_name: &str, parser: &Parser) {
5757
let mut index = 0;
5858
for line in json.lines() {
5959
index += 1;
60-
println!("{} {}", format!("{index}:"), line.bright_cyan());
60+
println!("{}: {}", index, line.bright_cyan());
6161
}
6262
}
6363
Err(_) => println!("{}", "Error serializing DataType".red()),
@@ -79,7 +79,7 @@ fn search_and_display_definitions(search_name: &str, parser: &Parser) {
7979
let mut index = 0;
8080
for line in json.lines() {
8181
index += 1;
82-
println!("{} {}", format!("{index}:"), line.bright_cyan());
82+
println!("{}: {}", index, line.bright_cyan());
8383
}
8484
}
8585
Err(_) => println!("{}", "Error serializing RuntimeFunction".red()),
@@ -89,10 +89,7 @@ fn search_and_display_definitions(search_name: &str, parser: &Parser) {
8989
}
9090

9191
if !found_any {
92-
println!(
93-
"{}",
94-
format!("\n{}: {}", "error".red(), "Found no matching definition(s)")
95-
);
92+
println!("\n{}: Found no matching definition(s)", "error".red(),);
9693
} else {
9794
success(format!("Found {total_matches} matching definition(s)"))
9895
}

crates/cli/src/formatter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ where
4646
Table::new(iter).with(Style::rounded()).to_string()
4747
}
4848

49-
fn print_path(path: &String) -> String {
49+
fn print_path(path: &str) -> String {
5050
format!("\n --> {}", &path.underline()).blue().to_string()
5151
}

crates/cli/src/table.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ pub fn feature_table(
7676
(flow_type_rows, data_type_rows, runtime_function_rows)
7777
}
7878

79-
pub fn summary_table(features: &Vec<Feature>) -> Vec<FeatureSummaryRow> {
79+
pub fn summary_table(features: &[Feature]) -> Vec<FeatureSummaryRow> {
8080
features
8181
.iter()
8282
.map(|feature| FeatureSummaryRow {

0 commit comments

Comments
 (0)