From 44cd43e7501ea5210a411c098641037b2457b43e Mon Sep 17 00:00:00 2001 From: Juha Kukkonen Date: Tue, 14 Mar 2023 00:16:29 +0200 Subject: [PATCH] Cargo format --- utoipa-gen/src/component/schema.rs | 3 ++- utoipa-gen/src/lib.rs | 2 +- utoipa-swagger-ui/build.rs | 4 +--- utoipa/src/openapi/encoding.rs | 2 +- utoipa/src/openapi/schema.rs | 1 - 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/utoipa-gen/src/component/schema.rs b/utoipa-gen/src/component/schema.rs index 647ed7d0..718e6d15 100644 --- a/utoipa-gen/src/component/schema.rs +++ b/utoipa-gen/src/component/schema.rs @@ -1610,7 +1610,8 @@ impl ToTokens for SchemaProperty<'_> { // add default minimum feature only when there is no explicit minimum // provided if !features - .iter().any(|feature| matches!(&feature, Feature::Minimum(_))) + .iter() + .any(|feature| matches!(&feature, Feature::Minimum(_))) { features.push(Minimum::new(0f64, type_path.span()).into()); } diff --git a/utoipa-gen/src/lib.rs b/utoipa-gen/src/lib.rs index 2f3f7389..92f472ce 100644 --- a/utoipa-gen/src/lib.rs +++ b/utoipa-gen/src/lib.rs @@ -170,7 +170,7 @@ use self::path::response::derive::{IntoResponses, ToResponse}; /// * and it does not have _`serde_with`_ _[`double_option`](https://docs.rs/serde_with/latest/serde_with/rust/double_option/index.html)_ /// * and it does not have default value provided with serde _`default`_ /// attribute -/// +/// /// Field is considered _`nullable`_ when field type is _`Option`_. /// /// ## Xml attribute Configuration Options diff --git a/utoipa-swagger-ui/build.rs b/utoipa-swagger-ui/build.rs index 93870f31..66b9e542 100644 --- a/utoipa-swagger-ui/build.rs +++ b/utoipa-swagger-ui/build.rs @@ -13,9 +13,7 @@ const SWAGGER_UI_DIST_ZIP: &str = "swagger-ui-4.15.5"; fn main() { println!("cargo:rerun-if-changed=res/{SWAGGER_UI_DIST_ZIP}.zip"); - println!( - "cargo:rustc-env=UTOIPA_SWAGGER_UI_VERSION={SWAGGER_UI_DIST_ZIP}" - ); + println!("cargo:rustc-env=UTOIPA_SWAGGER_UI_VERSION={SWAGGER_UI_DIST_ZIP}"); let target_dir = env::var("OUT_DIR").unwrap(); println!("cargo:rustc-env=UTOIPA_SWAGGER_DIR={}", &target_dir); diff --git a/utoipa/src/openapi/encoding.rs b/utoipa/src/openapi/encoding.rs index 399a0da3..a5096f44 100644 --- a/utoipa/src/openapi/encoding.rs +++ b/utoipa/src/openapi/encoding.rs @@ -81,4 +81,4 @@ impl EncodingBuilder { pub fn allow_reserved(mut self, allow_reserved: Option) -> Self { set_value!(self allow_reserved allow_reserved) } -} \ No newline at end of file +} diff --git a/utoipa/src/openapi/schema.rs b/utoipa/src/openapi/schema.rs index f2be21ea..42960aaa 100644 --- a/utoipa/src/openapi/schema.rs +++ b/utoipa/src/openapi/schema.rs @@ -678,7 +678,6 @@ fn is_false(value: &bool) -> bool { !*value } - impl Object { /// Initialize a new [`Object`] with default [`SchemaType`]. This effectively same as calling /// `Object::with_type(SchemaType::Object)`.