Skip to content

Commit b78aea7

Browse files
committed
Fix clippy
1 parent 8a28af3 commit b78aea7

3 files changed

Lines changed: 20 additions & 9 deletions

File tree

crates/vespertide-cli/src/commands/export.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,10 @@ fn ensure_mod_chain(root: &Path, rel_path: &Path) -> Result<()> {
100100
while let Some(child) = comps.pop() {
101101
let dir = root.join(comps.join(std::path::MAIN_SEPARATOR_STR));
102102
let mod_path = dir.join("mod.rs");
103-
if let Some(parent) = mod_path.parent() {
104-
if !parent.exists() {
105-
fs::create_dir_all(parent)?;
106-
}
103+
if let Some(parent) = mod_path.parent()
104+
&& !parent.exists()
105+
{
106+
fs::create_dir_all(parent)?;
107107
}
108108
let mut content = if mod_path.exists() {
109109
fs::read_to_string(&mod_path)?

crates/vespertide-cli/src/commands/new.rs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,10 @@ mod tests {
115115
}
116116

117117
fn write_config(model_format: FileFormat) {
118-
let cfg = VespertideConfig {model_format, ..VespertideConfig::default()};
118+
let cfg = VespertideConfig {
119+
model_format,
120+
..VespertideConfig::default()
121+
};
119122
let text = serde_json::to_string_pretty(&cfg).unwrap();
120123
std::fs::write("vespertide.json", text).unwrap();
121124
}
@@ -152,7 +155,10 @@ mod tests {
152155

153156
cmd_new("orders".into(), None).unwrap();
154157

155-
let cfg = VespertideConfig {model_format: FileFormat::Yaml, ..VespertideConfig::default()};
158+
let cfg = VespertideConfig {
159+
model_format: FileFormat::Yaml,
160+
..VespertideConfig::default()
161+
};
156162
let path = cfg.models_dir().join("orders.yaml");
157163
assert!(path.exists());
158164

@@ -175,7 +181,10 @@ mod tests {
175181

176182
cmd_new("products".into(), None).unwrap();
177183

178-
let cfg =VespertideConfig {model_format: FileFormat::Yml, ..VespertideConfig::default()};
184+
let cfg = VespertideConfig {
185+
model_format: FileFormat::Yml,
186+
..VespertideConfig::default()
187+
};
179188
let path = cfg.models_dir().join("products.yml");
180189
assert!(path.exists());
181190

@@ -205,4 +214,4 @@ mod tests {
205214
assert!(msg.contains("model file already exists"));
206215
assert!(msg.contains("users.json"));
207216
}
208-
}
217+
}

crates/vespertide-cli/src/commands/sql.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,9 @@ mod tests {
164164
nullable: false,
165165
default: None,
166166
}],
167-
constraints: vec![TableConstraint::PrimaryKey{columns: vec!["id".into()] }],
167+
constraints: vec![TableConstraint::PrimaryKey {
168+
columns: vec!["id".into()],
169+
}],
168170
}],
169171
};
170172
assert!(emit_sql(&plan).is_ok());

0 commit comments

Comments
 (0)