Skip to content

Commit

Permalink
Rust rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
GREsau committed Aug 28, 2024
1 parent 1c47af4 commit a85f0fc
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion schemars/src/json_schema_impls/either1.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::_alloc_prelude::*;
use crate::SchemaGenerator;
use crate::_alloc_prelude::*;
use crate::{json_schema, JsonSchema, Schema};
use alloc::borrow::Cow;
use either1::Either;
Expand Down
2 changes: 1 addition & 1 deletion schemars/src/json_schema_impls/primitives.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::_alloc_prelude::*;
use crate::SchemaGenerator;
use crate::_alloc_prelude::*;
use crate::{json_schema, JsonSchema, Schema};
use alloc::borrow::Cow;

Expand Down
2 changes: 1 addition & 1 deletion schemars/src/json_schema_impls/serdejson.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::_alloc_prelude::*;
use crate::SchemaGenerator;
use crate::_alloc_prelude::*;
use crate::{json_schema, JsonSchema, Schema};
use alloc::borrow::Cow;
use alloc::collections::BTreeMap;
Expand Down
10 changes: 7 additions & 3 deletions schemars_derive/src/attr/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ impl Format {
match s {
"email" => Format::Email,
"url" => Format::Uri,
_ => panic!("Invalid format attr string `{s}`. This is a bug in schemars, please raise an issue!"),
_ => {
panic!("Invalid format attr string `{s}`. This is a bug in schemars, please raise an issue!")
}
}
}
}
Expand Down Expand Up @@ -82,7 +84,7 @@ impl ValidationAttrs {
if let Some(format) = &self.format {
let f = format.schema_str();
mutators.push(quote! {
(#mut_ref_schema).ensure_object().insert("format".into(), #f.into());
(#mut_ref_schema).ensure_object().insert("format".into(), #f.into());
})
};

Expand Down Expand Up @@ -156,7 +158,9 @@ impl ValidationAttrs {
(_, Some(_), _) => cx.mutual_exclusive_error(&meta, "contains"),
(None, None, "schemars") => self.regex = parse_schemars_regex(meta, cx).ok(),
(None, None, "validate") => self.regex = parse_validate_regex(meta, cx).ok(),
(None, None, wat) => panic!("Unexpected attr type `{wat}` for regex item. This is a bug in schemars, please raise an issue!"),
(None, None, wat) => {
panic!("Unexpected attr type `{wat}` for regex item. This is a bug in schemars, please raise an issue!")
}
},
"contains" => match (&self.regex, &self.contains) {
(Some(_), _) => cx.mutual_exclusive_error(&meta, "regex"),
Expand Down

0 comments on commit a85f0fc

Please sign in to comment.