mirror of
https://gitlab.com/msrd0/gotham-restful.git
synced 2025-04-20 06:54:46 +00:00
fix some clippy warnings
This commit is contained in:
parent
147ea980bf
commit
d08d9bea8c
7 changed files with 46 additions and 48 deletions
|
@ -240,7 +240,7 @@ where
|
|||
|
||||
// get the secret from the handler, possibly decoding claims ourselves
|
||||
let secret = self.handler.jwt_secret(state, || {
|
||||
let b64 = token.split(".").nth(1)?;
|
||||
let b64 = token.split('.').nth(1)?;
|
||||
let raw = base64::decode_config(b64, base64::URL_SAFE_NO_PAD).ok()?;
|
||||
serde_json::from_slice(&raw).ok()?
|
||||
});
|
||||
|
@ -261,7 +261,7 @@ where
|
|||
};
|
||||
|
||||
// we found a valid token
|
||||
return AuthStatus::Authenticated(data);
|
||||
AuthStatus::Authenticated(data)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#![allow(clippy::tabs_in_doc_comments)]
|
||||
/*!
|
||||
This crate is an extension to the popular [gotham web framework][gotham] for Rust. The idea is to
|
||||
have several RESTful resources that can be added to the gotham router. This crate will take care
|
||||
|
|
|
@ -136,7 +136,7 @@ impl NewHandler for OpenapiHandler
|
|||
}
|
||||
|
||||
#[cfg(feature = "auth")]
|
||||
const SECURITY_NAME : &'static str = "authToken";
|
||||
const SECURITY_NAME : &str = "authToken";
|
||||
|
||||
#[cfg(feature = "auth")]
|
||||
fn get_security(state : &mut State) -> IndexMap<String, ReferenceOr<SecurityScheme>>
|
||||
|
@ -249,7 +249,7 @@ impl<'a> OperationParams<'a>
|
|||
{
|
||||
params.push(Item(Parameter::Path {
|
||||
parameter_data: ParameterData {
|
||||
name: param.to_string(),
|
||||
name: (*param).to_string(),
|
||||
description: None,
|
||||
required: true,
|
||||
deprecated: None,
|
||||
|
|
|
@ -9,7 +9,10 @@ use openapiv3::{
|
|||
};
|
||||
#[cfg(feature = "uuid")]
|
||||
use uuid::Uuid;
|
||||
use std::collections::{BTreeSet, HashSet};
|
||||
use std::{
|
||||
collections::{BTreeSet, HashSet},
|
||||
hash::BuildHasher
|
||||
};
|
||||
|
||||
/**
|
||||
This struct needs to be available for every type that can be part of an OpenAPI Spec. It is
|
||||
|
@ -296,7 +299,7 @@ impl<T : OpenapiType> OpenapiType for BTreeSet<T>
|
|||
}
|
||||
}
|
||||
|
||||
impl<T : OpenapiType> OpenapiType for HashSet<T>
|
||||
impl<T : OpenapiType, S : BuildHasher> OpenapiType for HashSet<T, S>
|
||||
{
|
||||
fn schema() -> OpenapiSchema
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue