Skip to content

Commit f836f36

Browse files
committed
chore: small formatting changes.
1 parent 3046658 commit f836f36

File tree

7 files changed

+13
-20
lines changed

7 files changed

+13
-20
lines changed

Cargo.lock

Lines changed: 4 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

typify-impl/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ syn = { version = "2.0.90", features = ["full"] }
2121
thiserror = "2.0.3"
2222
unicode-ident = "1.0.14"
2323

24+
2425
[dev-dependencies]
2526
env_logger = "0.10.2"
2627
expectorate = "1.1.0"

typify-impl/src/defaults.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ fn all_props<'a>(
620620

621621
// TODO Rather than an option, this should probably be something
622622
// that lets us say "explicit name" or "type to validate against"
623-
TypeEntryDetails::Map(value_id, _) => return vec![(None, value_id, false)],
623+
TypeEntryDetails::Map(_, value_id) => return vec![(None, value_id, false)],
624624
_ => unreachable!(),
625625
};
626626

typify-impl/src/structs.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ fn has_default(
460460
// No default specified.
461461
(Some(TypeEntryDetails::Option(_)), None) => StructPropertyState::Optional,
462462
(Some(TypeEntryDetails::Vec(_)), None) => StructPropertyState::Optional,
463-
(Some(TypeEntryDetails::Map { .. }), None) => StructPropertyState::Optional,
463+
(Some(TypeEntryDetails::Map(..)), None) => StructPropertyState::Optional,
464464
(Some(TypeEntryDetails::Unit), None) => StructPropertyState::Optional,
465465
(_, None) => StructPropertyState::Required,
466466

@@ -473,9 +473,7 @@ fn has_default(
473473
StructPropertyState::Optional
474474
}
475475
// Default specified is the same as the implicit default: {}
476-
(Some(TypeEntryDetails::Map { .. }), Some(serde_json::Value::Object(m)))
477-
if m.is_empty() =>
478-
{
476+
(Some(TypeEntryDetails::Map(..)), Some(serde_json::Value::Object(m))) if m.is_empty() => {
479477
StructPropertyState::Optional
480478
}
481479
// Default specified is the same as the implicit default: false

typify-impl/src/type_entry.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ impl TypeEntry {
595595
TypeEntryDetails::Unit
596596
| TypeEntryDetails::Option(_)
597597
| TypeEntryDetails::Vec(_)
598-
| TypeEntryDetails::Map { .. }
598+
| TypeEntryDetails::Map(_, _)
599599
| TypeEntryDetails::Set(_) => {
600600
matches!(impl_name, TypeSpaceImpl::Default)
601601
}
@@ -1750,7 +1750,7 @@ impl TypeEntry {
17501750
| TypeEntryDetails::Struct(_)
17511751
| TypeEntryDetails::Newtype(_)
17521752
| TypeEntryDetails::Vec(_)
1753-
| TypeEntryDetails::Map { .. }
1753+
| TypeEntryDetails::Map(..)
17541754
| TypeEntryDetails::Set(_)
17551755
| TypeEntryDetails::Box(_)
17561756
| TypeEntryDetails::Native(_)

typify-impl/src/value.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ impl TypeEntry {
9595
.collect::<Option<Vec<_>>>()?;
9696
quote! { vec![#(#values),*] }
9797
}
98-
TypeEntryDetails::Map(key_id, value_id, ..) => {
98+
TypeEntryDetails::Map(key_id, value_id) => {
9999
let obj = value.as_object()?;
100100
let key_ty = type_space.id_to_entry.get(key_id).unwrap();
101101
let value_ty = type_space.id_to_entry.get(value_id).unwrap();
@@ -424,7 +424,7 @@ fn value_for_struct_props(
424424
match &type_entry.details {
425425
TypeEntryDetails::Struct(_)
426426
| TypeEntryDetails::Option(_)
427-
| TypeEntryDetails::Map { .. } => (),
427+
| TypeEntryDetails::Map(..) => (),
428428
_ => unreachable!(),
429429
}
430430

typify-test/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ prettyplease = "0.2.25"
1414
schemars = "0.8.21"
1515
serde = "1.0.215"
1616
syn = "2.0.90"
17-
typify = { path = "../typify"}
17+
typify = { path = "../typify" }

0 commit comments

Comments
 (0)