Skip to content

Commit e3fb46f

Browse files
committed
Use snake_case instead of kebab-case in diesel.toml
All other fields in diesel.toml are snake case. `filter` should be, too.
1 parent 06fd746 commit e3fb46f

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

diesel_cli/src/print_schema.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ impl<'de> Deserialize<'de> for Filtering {
306306
type Value = Filtering;
307307

308308
fn expecting(&self, f: &mut fmt::Formatter) -> fmt::Result {
309-
f.write_str("either only-tables or except-tables")
309+
f.write_str("either only_tables or except_tables")
310310
}
311311

312312
fn visit_map<V>(self, mut map: V) -> Result<Self::Value, V::Error>
@@ -317,28 +317,28 @@ impl<'de> Deserialize<'de> for Filtering {
317317
let mut except_tables = None;
318318
while let Some((key, value)) = map.next_entry()? {
319319
match key {
320-
"only-tables" => {
320+
"only_tables" => {
321321
if only_tables.is_some() {
322-
return Err(de::Error::duplicate_field("only-tables"));
322+
return Err(de::Error::duplicate_field("only_tables"));
323323
}
324324
only_tables = Some(value);
325325
}
326-
"except-tables" => {
326+
"except_tables" => {
327327
if except_tables.is_some() {
328-
return Err(de::Error::duplicate_field("except-tables"));
328+
return Err(de::Error::duplicate_field("except_tables"));
329329
}
330330
except_tables = Some(value);
331331
}
332332
_ => {
333333
return Err(de::Error::unknown_field(
334334
key,
335-
&["only-tables", "except-tables"],
335+
&["only_tables", "except_tables"],
336336
))
337337
}
338338
}
339339
}
340340
match (only_tables, except_tables) {
341-
(Some(_), Some(_)) => Err(de::Error::duplicate_field("except-tables")),
341+
(Some(_), Some(_)) => Err(de::Error::duplicate_field("except_tables")),
342342
(Some(w), None) => Ok(Filtering::OnlyTables(w)),
343343
(None, Some(b)) => Ok(Filtering::ExceptTables(b)),
344344
(None, None) => Ok(Filtering::None),
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[print_schema]
22
file = "src/schema.rs"
33
with_docs = true
4-
filter = { except-tables = ["users1"] }
4+
filter = { except_tables = ["users1"] }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[print_schema]
22
file = "src/schema.rs"
33
with_docs = true
4-
filter = { only-tables = ["users1"] }
4+
filter = { only_tables = ["users1"] }

0 commit comments

Comments
 (0)