Skip to content

Commit 7ad6839

Browse files
committed
ref: correct fmt
1 parent b6501ab commit 7ad6839

File tree

5 files changed

+34
-27
lines changed

5 files changed

+34
-27
lines changed

cli/src/analyser/mod.rs

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -472,23 +472,25 @@ impl Analyser {
472472

473473
// Check if input identifier exists
474474
if let Some(identifier) = flow.input_type_identifier
475-
&& !self.data_type_identifier_exists(identifier.clone(), -1) {
476-
self.reporter.add_report(Diagnose::new(
477-
name.clone(),
478-
original_definition.clone(),
479-
UndefinedDataTypeIdentifier { identifier },
480-
));
481-
}
475+
&& !self.data_type_identifier_exists(identifier.clone(), -1)
476+
{
477+
self.reporter.add_report(Diagnose::new(
478+
name.clone(),
479+
original_definition.clone(),
480+
UndefinedDataTypeIdentifier { identifier },
481+
));
482+
}
482483

483484
// Check if return identifier exists
484485
if let Some(identifier) = flow.return_type_identifier
485-
&& !self.data_type_identifier_exists(identifier.clone(), -1) {
486-
self.reporter.add_report(Diagnose::new(
487-
name.clone(),
488-
original_definition.clone(),
489-
UndefinedDataTypeIdentifier { identifier },
490-
));
491-
}
486+
&& !self.data_type_identifier_exists(identifier.clone(), -1)
487+
{
488+
self.reporter.add_report(Diagnose::new(
489+
name.clone(),
490+
original_definition.clone(),
491+
UndefinedDataTypeIdentifier { identifier },
492+
));
493+
}
492494

493495
// Check if flow type identifier already exists
494496
for flow_type in &self.flow_types {

cli/src/command/download.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -182,13 +182,14 @@ async fn convert_bytes_to_folder(bytes: Bytes, zip_path: &str) {
182182
} else {
183183
if let Some(p) = out_path.parent()
184184
&& !p.exists()
185-
&& let Err(e) = fs::create_dir_all(p) {
186-
panic!(
187-
"Warning: Failed to create parent directory {}: {}",
188-
p.display(),
189-
e
190-
);
191-
}
185+
&& let Err(e) = fs::create_dir_all(p)
186+
{
187+
panic!(
188+
"Warning: Failed to create parent directory {}: {}",
189+
p.display(),
190+
e
191+
);
192+
}
192193

193194
match File::create(&out_path) {
194195
Ok(mut outfile) => {

cli/src/command/feature.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ pub fn search_feature(name: Option<String>, path: Option<String>) {
2121
Some(feature_name) => parser
2222
.features
2323
.iter()
24-
.filter(|f| f.name.to_lowercase() == feature_name.to_lowercase()).cloned()
24+
.filter(|f| f.name.to_lowercase() == feature_name.to_lowercase())
25+
.cloned()
2526
.collect::<Vec<Feature>>(),
2627
};
27-
28+
2829
for feature in &features {
2930
let (flow_type_rows, data_type_rows, function_rows) = feature_table(feature);
3031

cli/src/command/watch.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,18 @@ pub async fn watch_for_changes(path: Option<String>) {
2727
loop {
2828
if let Ok(Ok(event)) = rx.recv() {
2929
match event.kind {
30-
EventKind::Modify(modify) => if let ModifyKind::Data(_) = modify
31-
&& last_run.elapsed() > Duration::from_millis(500) {
30+
EventKind::Modify(modify) => {
31+
if let ModifyKind::Data(_) = modify
32+
&& last_run.elapsed() > Duration::from_millis(500)
33+
{
3234
default(String::from(
3335
"\n\n\n--------------------------------------------------------------------------\n\n",
3436
));
3537
info(String::from("Change detected! Regenerating report..."));
3638
Analyser::new(dir_path.as_str()).report(false);
3739
last_run = Instant::now();
38-
},
40+
}
41+
}
3942
EventKind::Remove(_) => {
4043
if last_run.elapsed() > Duration::from_millis(500) {
4144
default(String::from(

cli/src/table.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use code0_definition_reader::parser::Feature;
2-
use tabled::{Tabled};
2+
use tabled::Tabled;
33
use tucana::shared::{DefinitionDataType, FlowType, RuntimeFunctionDefinition};
44

55
#[derive(Tabled)]

0 commit comments

Comments
 (0)