Skip to content

Commit 34a600d

Browse files
MecryTvMecryTv
authored andcommitted
[ref] cargo clippy & format
1 parent 32b059a commit 34a600d

File tree

2 files changed

+27
-31
lines changed

2 files changed

+27
-31
lines changed

crates/cli/src/analyser/flow_type.rs

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

39-
if let Some(identifier) = &flow.input_type_identifier {
40-
if !self.data_type_identifier_exists(identifier, None) {
41-
self.reporter.add(Diagnose::new(
42-
name.clone(),
43-
original.clone(),
44-
DiagnosticKind::UndefinedDataTypeIdentifier {
45-
identifier: identifier.clone(),
46-
},
47-
));
48-
}
39+
if let Some(identifier) = &flow.input_type_identifier
40+
&& !self.data_type_identifier_exists(identifier, None)
41+
{
42+
self.reporter.add(Diagnose::new(
43+
name.clone(),
44+
original.clone(),
45+
DiagnosticKind::UndefinedDataTypeIdentifier {
46+
identifier: identifier.clone(),
47+
},
48+
));
4949
}
50-
if let Some(identifier) = &flow.return_type_identifier {
51-
if !self.data_type_identifier_exists(identifier, None) {
52-
self.reporter.add(Diagnose::new(
53-
name.clone(),
54-
original.clone(),
55-
DiagnosticKind::UndefinedDataTypeIdentifier {
56-
identifier: identifier.clone(),
57-
},
58-
));
59-
}
50+
if let Some(identifier) = &flow.return_type_identifier
51+
&& !self.data_type_identifier_exists(identifier, None)
52+
{
53+
self.reporter.add(Diagnose::new(
54+
name.clone(),
55+
original.clone(),
56+
DiagnosticKind::UndefinedDataTypeIdentifier {
57+
identifier: identifier.clone(),
58+
},
59+
));
6060
}
6161

6262
for setting in &flow.settings {

crates/package/src/lib.rs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
use std::{fs, io};
2-
use std::path::Path;
3-
use serde::de::DeserializeOwned;
41
use serde::Deserialize;
2+
use serde::de::DeserializeOwned;
3+
use std::path::Path;
4+
use std::{fs, io};
55
use tucana::shared::{DefinitionDataType, FlowType, RuntimeFunctionDefinition};
66
use walkdir::WalkDir;
77

@@ -10,7 +10,7 @@ pub struct Feature {
1010
pub name: String,
1111
pub data_types: Vec<DefinitionDataType>,
1212
pub flow_types: Vec<FlowType>,
13-
pub functions: Vec<RuntimeFunctionDefinition>
13+
pub functions: Vec<RuntimeFunctionDefinition>,
1414
}
1515

1616
pub fn read_features(path: &str) -> Result<Vec<Feature>, io::Error> {
@@ -88,14 +88,10 @@ where
8888
return Ok(definitions);
8989
}
9090

91-
for entry in WalkDir::new(dir)
92-
.into_iter()
93-
.filter_map(Result::ok)
94-
{
91+
for entry in WalkDir::new(dir).into_iter().filter_map(Result::ok) {
9592
let path = entry.path();
9693

97-
if path.is_file() && path.extension().map_or(false, |ext| ext == "json") {
98-
94+
if path.is_file() && path.extension().is_some_and(|ext| ext == "json") {
9995
let content = match fs::read_to_string(path) {
10096
Ok(content) => content,
10197
Err(err) => {
@@ -114,4 +110,4 @@ where
114110
}
115111

116112
Ok(definitions)
117-
}
113+
}

0 commit comments

Comments
 (0)