Skip to content

Commit a3d1148

Browse files
committed
Fix a few more clippy lints
1 parent 3eaa27c commit a3d1148

File tree

6 files changed

+8
-38
lines changed

6 files changed

+8
-38
lines changed

crates/data-model/src/upstream_oauth2/provider.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ pub struct UpstreamOAuthProvider {
289289

290290
impl PartialOrd for UpstreamOAuthProvider {
291291
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
292-
Some(self.id.cmp(&other.id))
292+
Some(self.cmp(other))
293293
}
294294
}
295295

crates/handlers/src/graphql/model/oauth.rs

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ use anyhow::Context as _;
88
use async_graphql::{Context, Description, Enum, ID, Object};
99
use chrono::{DateTime, Utc};
1010
use mas_storage::{oauth2::OAuth2ClientRepository, user::BrowserSessionRepository};
11-
use oauth2_types::{oidc::ApplicationType, scope::Scope};
12-
use ulid::Ulid;
11+
use oauth2_types::oidc::ApplicationType;
1312
use url::Url;
1413

1514
use super::{BrowserSession, NodeType, SessionState, User, UserAgent};
@@ -200,33 +199,3 @@ impl OAuth2Client {
200199
}
201200
}
202201
}
203-
204-
/// An OAuth 2.0 consent represents the scope a user consented to grant to a
205-
/// client.
206-
#[derive(Description)]
207-
pub struct OAuth2Consent {
208-
scope: Scope,
209-
client_id: Ulid,
210-
}
211-
212-
#[Object(use_type_description)]
213-
impl OAuth2Consent {
214-
/// Scope consented by the user for this client.
215-
pub async fn scope(&self) -> String {
216-
self.scope.to_string()
217-
}
218-
219-
/// OAuth 2.0 client for which the user granted access.
220-
pub async fn client(&self, ctx: &Context<'_>) -> Result<OAuth2Client, async_graphql::Error> {
221-
let state = ctx.state();
222-
let mut repo = state.repository().await?;
223-
let client = repo
224-
.oauth2_client()
225-
.lookup(self.client_id)
226-
.await?
227-
.context("Could not load client")?;
228-
repo.cancel().await?;
229-
230-
Ok(OAuth2Client(client))
231-
}
232-
}

crates/i18n/src/sprintf/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ pub(crate) use sprintf;
7272

7373
#[derive(Debug, thiserror::Error)]
7474
#[error(transparent)]
75+
#[allow(dead_code)]
7576
enum Error {
7677
Format(#[from] self::formatter::FormatError),
7778
Parse(Box<self::parser::Error>),

crates/storage-pg/src/compat/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ mod tests {
697697
// List all logins
698698
let logins = repo.compat_sso_login().list(all, pagination).await.unwrap();
699699
assert!(!logins.has_next_page);
700-
assert_eq!(logins.edges, &[login.clone()]);
700+
assert_eq!(logins.edges, vec![login.clone()]);
701701

702702
// List the logins for the user
703703
let logins = repo
@@ -706,7 +706,7 @@ mod tests {
706706
.await
707707
.unwrap();
708708
assert!(!logins.has_next_page);
709-
assert_eq!(logins.edges, &[login.clone()]);
709+
assert_eq!(logins.edges, vec![login.clone()]);
710710

711711
// List only the pending logins for the user
712712
let logins = repo

crates/templates/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ register_templates! {
328328
/// Render the Swagger API reference
329329
pub fn render_swagger(ApiDocContext) { "swagger/doc.html" }
330330

331-
/// Render the Swagger OAuth2 callback page
331+
/// Render the Swagger OAuth callback page
332332
pub fn render_swagger_callback(ApiDocContext) { "swagger/oauth2-redirect.html" }
333333

334334
/// Render the login page
@@ -382,7 +382,7 @@ register_templates! {
382382
/// Render the account recovery disabled page
383383
pub fn render_recovery_disabled(WithLanguage<EmptyContext>) { "pages/recovery/disabled.html" }
384384

385-
/// Render the form used by the form_post response mode
385+
/// Render the form used by the `form_post` response mode
386386
pub fn render_form_post<T: Serialize>(WithLanguage<FormPostContext<T>>) { "form_post.html" }
387387

388388
/// Render the HTML error page

docs/config.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2155,7 +2155,7 @@
21552155
"type": "boolean"
21562156
},
21572157
"on_backchannel_logout": {
2158-
"description": "What to do when receiving an OIDC Backchannel logout request.\n\nDefaults to \"do_nothing\".",
2158+
"description": "What to do when receiving an OIDC Backchannel logout request.\n\nDefaults to `do_nothing`.",
21592159
"allOf": [
21602160
{
21612161
"$ref": "#/definitions/OnBackchannelLogout"

0 commit comments

Comments
 (0)