1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-07-29 22:01:14 +03:00

Upgrade Rust to 1.72.0

Fixes new clippy errors and upgrade other tools
This commit is contained in:
Quentin Gliech
2023-08-28 17:40:49 +02:00
parent d9a12de8a3
commit 17e28f56c1
15 changed files with 38 additions and 29 deletions

View File

@ -108,6 +108,13 @@ pub struct CookieJar {
}
impl CookieJar {
/// Save the given payload in a cookie
///
/// If `permanent` is true, the cookie will be valid for 10 years
///
/// # Panics
///
/// Panics if the payload cannot be serialized
#[must_use]
pub fn save<T: Serialize>(mut self, key: &str, payload: &T, permanent: bool) -> Self {
let serialized =

View File

@ -300,7 +300,7 @@ impl Options {
continue;
}
for scope in oauth2_session.scope.iter() {
for scope in &*oauth2_session.scope {
if let Some(device) = Device::from_scope_token(scope) {
// Schedule a job to delete the device.
repo.job()

View File

@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
pub(self) mod authorization_grant;
pub(self) mod client;
pub(self) mod session;
mod authorization_grant;
mod client;
mod session;
pub use self::{
authorization_grant::{AuthorizationCode, AuthorizationGrant, AuthorizationGrantStage, Pkce},

View File

@ -109,7 +109,7 @@ impl OAuth2SessionMutations {
// XXX: this might not be the right semantic, but it's the best we
// can do for now, since we're not explicitly storing devices for OAuth2
// sessions.
for scope in session.scope.iter() {
for scope in &*session.scope {
if let Some(device) = Device::from_scope_token(scope) {
// Schedule a job to delete the device.
repo.job()

View File

@ -213,7 +213,7 @@ pub(crate) async fn post(
// XXX: this might not be the right semantic, but it's the best we
// can do for now, since we're not explicitly storing devices for OAuth2
// sessions.
for scope in session.scope.iter() {
for scope in &*session.scope {
if let Some(device) = Device::from_scope_token(scope) {
// Schedule a job to delete the device.
repo.job()

View File

@ -337,7 +337,7 @@ async fn authorization_code_grant(
}
// Look for device to provision
for scope in session.scope.iter() {
for scope in &*session.scope {
if let Some(device) = Device::from_scope_token(scope) {
// Note that we're not waiting for the job to finish, we just schedule it. We
// might get in a situation where the provisioning job is not finished when the

View File

@ -61,7 +61,7 @@ impl CorsLayerExt for CorsLayer {
H: IntoIterator<Item = HeaderName>,
{
let base = PROPAGATOR_HEADERS.get().cloned().unwrap_or_default();
let headers: Vec<_> = headers.into_iter().chain(base.into_iter()).collect();
let headers: Vec<_> = headers.into_iter().chain(base).collect();
self.allow_headers(headers)
}
}

View File

@ -17,7 +17,7 @@ use sha2::{Sha256, Sha384, Sha512};
mod asymmetric;
pub(crate) mod hmac;
pub(self) mod signature;
mod signature;
mod symmetric;
pub use self::{

View File

@ -80,6 +80,10 @@ impl<T> MaybeTlsStream<T> {
/// Gather informations about the TLS connection. Returns `None` if the
/// stream is not a TLS stream.
///
/// # Panics
///
/// Panics if the TLS handshake is not done yet, which should never happen
pub fn tls_info(&self) -> Option<TlsStreamInfo> {
let conn = self.get_tls_connection()?;

View File

@ -317,7 +317,7 @@ impl fmt::Debug for AuthorizationRequest {
.field("request", &self.request)
.field("request_uri", &self.request_uri)
.field("registration", &self.registration)
.finish()
.finish_non_exhaustive()
}
}
@ -422,7 +422,7 @@ impl fmt::Debug for DeviceAuthorizationResponse {
.field("verification_uri", &self.verification_uri)
.field("expires_in", &self.expires_in)
.field("interval", &self.interval)
.finish()
.finish_non_exhaustive()
}
}