Skip to content

Commit 34a5b47

Browse files
committed
chore: run rustfmt
Signed-off-by: Shane Utt <[email protected]>
1 parent 1bbb9f4 commit 34a5b47

File tree

2 files changed

+27
-28
lines changed

2 files changed

+27
-28
lines changed

kube-core/src/schema.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
// Used in docs
66
#[allow(unused_imports)] use schemars::generate::SchemaSettings;
77

8-
use schemars::{transform::Transform, JsonSchema};
8+
use schemars::{JsonSchema, transform::Transform};
99
use serde::{Deserialize, Serialize};
1010
use serde_json::Value;
11-
use std::collections::{btree_map::Entry, BTreeMap, BTreeSet};
11+
use std::collections::{BTreeMap, BTreeSet, btree_map::Entry};
1212

1313
/// schemars [`Visitor`] that rewrites a [`Schema`] to conform to Kubernetes' "structural schema" rules
1414
///
@@ -390,10 +390,12 @@ fn hoist_subschema_properties(
390390
}
391391
Entry::Occupied(entry) => {
392392
if &property != entry.get() {
393-
panic!("Property {:?} has the schema {:?} but was already defined as {:?} in another subschema. The schemas for a property used in multiple subschemas must be identical",
394-
entry.key(),
395-
&property,
396-
entry.get());
393+
panic!(
394+
"Property {:?} has the schema {:?} but was already defined as {:?} in another subschema. The schemas for a property used in multiple subschemas must be identical",
395+
entry.key(),
396+
&property,
397+
entry.get()
398+
);
397399
}
398400
}
399401
}

kube-derive/tests/crd_schema_test.rs

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -173,28 +173,25 @@ fn test_shortnames() {
173173
#[test]
174174
fn test_serialized_matches_expected() {
175175
assert_json_eq!(
176-
serde_json::to_value(Foo::new(
177-
"bar",
178-
FooSpec {
179-
non_nullable: "asdf".to_string(),
180-
non_nullable_with_default: "asdf".to_string(),
181-
nullable_skipped: None,
182-
nullable: None,
183-
nullable_skipped_with_default: None,
184-
nullable_with_default: None,
185-
timestamp: DateTime::from_timestamp(0, 0).unwrap(),
186-
complex_enum: ComplexEnum::VariantOne { int: 23 },
187-
untagged_enum_person: UntaggedEnumPerson::GenderAndAge(GenderAndAge {
188-
age: 42,
189-
gender: Gender::Male,
190-
}),
191-
associated_default: false,
192-
my_list: vec!["".into()],
193-
set: HashSet::from(["foo".to_owned()]),
194-
x_kubernetes_set: vec![],
195-
optional_enum: Some(Gender::Other),
196-
}
197-
))
176+
serde_json::to_value(Foo::new("bar", FooSpec {
177+
non_nullable: "asdf".to_string(),
178+
non_nullable_with_default: "asdf".to_string(),
179+
nullable_skipped: None,
180+
nullable: None,
181+
nullable_skipped_with_default: None,
182+
nullable_with_default: None,
183+
timestamp: DateTime::from_timestamp(0, 0).unwrap(),
184+
complex_enum: ComplexEnum::VariantOne { int: 23 },
185+
untagged_enum_person: UntaggedEnumPerson::GenderAndAge(GenderAndAge {
186+
age: 42,
187+
gender: Gender::Male,
188+
}),
189+
associated_default: false,
190+
my_list: vec!["".into()],
191+
set: HashSet::from(["foo".to_owned()]),
192+
x_kubernetes_set: vec![],
193+
optional_enum: Some(Gender::Other),
194+
}))
198195
.unwrap(),
199196
serde_json::json!({
200197
"apiVersion": "clux.dev/v1",

0 commit comments

Comments
 (0)