Rust rustfmt

This commit is contained in:
Graham Esau 2024-08-28 09:16:29 +01:00
parent 1c47af475f
commit a85f0fc7bc
4 changed files with 10 additions and 6 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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!")
}
}
}
}
@ -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());
})
};
@ -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"),