Run cargo fmt

This commit is contained in:
Graham Esau 2019-12-29 22:09:54 +00:00
parent 98f981634c
commit 58cc7fac25
22 changed files with 57 additions and 74 deletions

View file

@ -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"))
}
}

View file

@ -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() {

View file

@ -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() {

View file

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

View file

@ -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() {

View file

@ -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() {