Skip to content

Commit

Permalink
Address new rust 1.63 clippy rules
Browse files Browse the repository at this point in the history
  • Loading branch information
juhaku committed Aug 25, 2022
1 parent 372a290 commit 8318f53
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions utoipa-gen/src/component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -248,15 +248,15 @@ impl PartialEq for TypeTree<'_> {
}

#[cfg_attr(feature = "debug", derive(Debug))]
#[derive(Clone, Copy, PartialEq)]
#[derive(Clone, Copy, PartialEq, Eq)]
pub enum ValueType {
Primitive,
Object,
Tuple,
}

#[cfg_attr(feature = "debug", derive(Debug))]
#[derive(PartialEq, Clone, Copy)]
#[derive(PartialEq, Eq, Clone, Copy)]
pub enum GenericType {
Vec,
Map,
Expand Down
2 changes: 1 addition & 1 deletion utoipa-gen/src/component/into_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ impl ToTokens for ParamType<'_> {
}
}
ValueType::Object => {
let component_path: &syn::TypePath = &*component
let component_path = component
.path
.as_ref()
.expect("component should have a path");
Expand Down
2 changes: 1 addition & 1 deletion utoipa-gen/src/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub struct IntoParamsType<'a> {
}

#[cfg_attr(feature = "debug", derive(Debug))]
#[derive(PartialEq)]
#[derive(PartialEq, Eq)]
pub enum ArgumentIn {
Path,
#[cfg(feature = "rocket_extras")]
Expand Down
2 changes: 1 addition & 1 deletion utoipa-gen/src/ext/rocket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ impl PathResolver for PathOperations {

whole_path
.split_once('?')
.or(Some((&*whole_path, "")))
.or(Some((whole_path, "")))
.map(|(path, query)| {
let mut names =
Vec::<MacroArg>::with_capacity(RE.find_iter(whole_path).count());
Expand Down
2 changes: 1 addition & 1 deletion utoipa-gen/src/path/parameter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ impl StructParameter {
}

#[cfg_attr(feature = "debug", derive(Debug))]
#[derive(PartialEq, Clone, Copy)]
#[derive(PartialEq, Eq, Clone, Copy)]
pub enum ParameterIn {
Query,
Path,
Expand Down
2 changes: 1 addition & 1 deletion utoipa-gen/src/path/property.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ impl ToTokens for Property<'_> {
utoipa::openapi::PropertyBuilder::new().schema_type(#schema_type)
};

let format: SchemaFormat = (&*schema_type.0).into();
let format: SchemaFormat = schema_type.0.into();
if format.is_known_format() {
schema.extend(quote! {
.format(Some(#format))
Expand Down
4 changes: 2 additions & 2 deletions utoipa/src/openapi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ impl Default for OpenApiVersion {
/// Value used to indicate whether reusable schema, parameter or operation is deprecated.
///
/// The value will serialize to boolean.
#[derive(PartialEq, Clone)]
#[derive(PartialEq, Eq, Clone)]
#[cfg_attr(feature = "debug", derive(Debug))]
pub enum Deprecated {
True,
Expand Down Expand Up @@ -271,7 +271,7 @@ impl Default for Deprecated {
/// Value used to indicate whether parameter or property is required.
///
/// The value will serialize to boolean.
#[derive(PartialEq, Clone)]
#[derive(PartialEq, Eq, Clone)]
#[cfg_attr(feature = "debug", derive(Debug))]
pub enum Required {
True,
Expand Down
2 changes: 1 addition & 1 deletion utoipa/src/openapi/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ impl ParameterBuilder {
}

/// In definition of [`Parameter`].
#[derive(Serialize, Deserialize, PartialEq, Clone)]
#[derive(Serialize, Deserialize, PartialEq, Eq, Clone)]
#[serde(rename_all = "lowercase")]
#[cfg_attr(feature = "debug", derive(Debug))]
pub enum ParameterIn {
Expand Down
2 changes: 1 addition & 1 deletion utoipa/src/openapi/security.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ impl HttpBuilder {
/// Implements types according [RFC7235](https://datatracker.ietf.org/doc/html/rfc7235#section-5.1).
///
/// Types are maintainted at <https://www.iana.org/assignments/http-authschemes/http-authschemes.xhtml>.
#[derive(Serialize, Deserialize, Clone, PartialEq)]
#[derive(Serialize, Deserialize, Clone, PartialEq, Eq)]
#[cfg_attr(feature = "debug", derive(Debug))]
#[serde(rename_all = "lowercase")]
pub enum HttpAuthScheme {
Expand Down

0 comments on commit 8318f53

Please sign in to comment.