Format project with rustfmt

This commit is contained in:
Graham Esau 2019-12-09 17:37:49 +00:00
parent e4d69f89e7
commit 1f021fa5ae
6 changed files with 13 additions and 9 deletions

View file

@ -10,7 +10,7 @@ pub struct MyStruct {
#[derive(JsonSchema)] #[derive(JsonSchema)]
pub enum MyEnum { pub enum MyEnum {
Unit, Unit,
StringNewType(String) StringNewType(String),
} }
fn main() { fn main() {

View file

@ -15,7 +15,7 @@ pub struct MyStruct {
#[serde(untagged)] #[serde(untagged)]
pub enum MyEnum { pub enum MyEnum {
Unit, Unit,
StringNewType(String) StringNewType(String),
} }
fn main() { fn main() {

View file

@ -14,8 +14,10 @@ impl JsonSchema for Duration {
let obj = schema.object(); let obj = schema.object();
obj.required.insert("secs".to_owned()); obj.required.insert("secs".to_owned());
obj.required.insert("nanos".to_owned()); obj.required.insert("nanos".to_owned());
obj.properties.insert("secs".to_owned(), <u64>::json_schema(gen)); obj.properties
obj.properties.insert("nanos".to_owned(), <u32>::json_schema(gen)); .insert("secs".to_owned(), <u64>::json_schema(gen));
obj.properties
.insert("nanos".to_owned(), <u32>::json_schema(gen));
schema.into() schema.into()
} }
} }
@ -31,8 +33,10 @@ impl JsonSchema for SystemTime {
let obj = schema.object(); let obj = schema.object();
obj.required.insert("secs_since_epoch".to_owned()); obj.required.insert("secs_since_epoch".to_owned());
obj.required.insert("nanos_since_epoch".to_owned()); obj.required.insert("nanos_since_epoch".to_owned());
obj.properties.insert("secs_since_epoch".to_owned(), <u64>::json_schema(gen)); obj.properties
obj.properties.insert("nanos_since_epoch".to_owned(), <u32>::json_schema(gen)); .insert("secs_since_epoch".to_owned(), <u64>::json_schema(gen));
obj.properties
.insert("nanos_since_epoch".to_owned(), <u32>::json_schema(gen));
schema.into() schema.into()
} }
} }

View file

@ -1,7 +1,7 @@
mod util; mod util;
use schemars::JsonSchema; use schemars::JsonSchema;
use util::*;
use std::ffi::{OsStr, OsString}; use std::ffi::{OsStr, OsString};
use util::*;
#[derive(Debug, JsonSchema)] #[derive(Debug, JsonSchema)]
struct OsStrings { struct OsStrings {

View file

@ -7,7 +7,7 @@ use util::*;
struct MyStruct { struct MyStruct {
range: Range<usize>, range: Range<usize>,
inclusive: RangeInclusive<f64>, inclusive: RangeInclusive<f64>,
bound: Bound<String> bound: Bound<String>,
} }
#[test] #[test]

View file

@ -1,7 +1,7 @@
mod util; mod util;
use schemars::JsonSchema; use schemars::JsonSchema;
use util::*;
use std::time::{Duration, SystemTime}; use std::time::{Duration, SystemTime};
use util::*;
#[derive(Debug, JsonSchema)] #[derive(Debug, JsonSchema)]
struct MyStruct { struct MyStruct {