Run cargo fmt
This commit is contained in:
parent
98f981634c
commit
58cc7fac25
22 changed files with 57 additions and 74 deletions
|
@ -38,7 +38,9 @@ mod as_string {
|
|||
D: Deserializer<'de>,
|
||||
{
|
||||
let string = String::deserialize(deserializer)?;
|
||||
string.parse().map_err(|_| D::Error::custom("Input was not valid"))
|
||||
string
|
||||
.parse()
|
||||
.map_err(|_| D::Error::custom("Input was not valid"))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ pub struct MyStruct {
|
|||
|
||||
/// # My Amazing Enum
|
||||
#[derive(JsonSchema)]
|
||||
pub enum MyEnum {
|
||||
pub enum MyEnum {
|
||||
/// A wrapper around a `String`
|
||||
StringNewType(String),
|
||||
/// A struct-like enum variant which contains
|
||||
|
@ -24,7 +24,7 @@ pub enum MyEnum {
|
|||
StructVariant {
|
||||
/// The floats themselves
|
||||
floats: Vec<f32>,
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
|
|
@ -8,11 +8,9 @@ pub struct MyStruct {
|
|||
}
|
||||
|
||||
#[derive(JsonSchema)]
|
||||
pub enum MyEnum {
|
||||
pub enum MyEnum {
|
||||
StringNewType(String),
|
||||
StructVariant {
|
||||
floats: Vec<f32>,
|
||||
}
|
||||
StructVariant { floats: Vec<f32> },
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
// Pretend that this is somebody else's crate, not a module.
|
||||
mod other_crate {
|
||||
// Neither Schemars nor the other crate provides a JsonSchema impl
|
||||
// Neither Schemars nor the other crate provides a JsonSchema impl
|
||||
// for this struct.
|
||||
pub struct Duration {
|
||||
pub secs: i64,
|
||||
|
|
|
@ -14,11 +14,9 @@ pub struct MyStruct {
|
|||
|
||||
#[derive(Deserialize, Serialize, JsonSchema)]
|
||||
#[schemars(untagged)]
|
||||
pub enum MyEnum {
|
||||
pub enum MyEnum {
|
||||
StringNewType(String),
|
||||
StructVariant {
|
||||
floats: Vec<f32>,
|
||||
}
|
||||
StructVariant { floats: Vec<f32> },
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
|
|
@ -13,11 +13,9 @@ pub struct MyStruct {
|
|||
|
||||
#[derive(Deserialize, Serialize, JsonSchema)]
|
||||
#[serde(untagged)]
|
||||
pub enum MyEnum {
|
||||
pub enum MyEnum {
|
||||
StringNewType(String),
|
||||
StructVariant {
|
||||
floats: Vec<f32>,
|
||||
}
|
||||
StructVariant { floats: Vec<f32> },
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue