Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Gottox committed Nov 5, 2024
1 parent 2636ec2 commit 28f092d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
6 changes: 4 additions & 2 deletions src/controller/api_object_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,10 @@ impl LifecycleController for KeycloakApiObjectController {
.as_ref()
.and_then(|x| x.resource_path.as_ref())
{
if let Some(_) =
self.request(&keycloak, Method::PUT, path, &payload).await?
if self
.request(&keycloak, Method::PUT, path, &payload)
.await?
.is_some()
{
success = true;
api.patch_status(
Expand Down
18 changes: 9 additions & 9 deletions src/crd/refs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@ use serde::{Deserialize, Serialize};
pub struct ClientRef {
pub client_ref: String,
}
impl Into<String> for ClientRef {
fn into(self) -> String {
self.client_ref
impl From<ClientRef> for String {
fn from(val: ClientRef) -> Self {
val.client_ref
}
}
#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct ClientScopeRef {
pub client_scope_ref: String,
}
impl Into<String> for ClientScopeRef {
fn into(self) -> String {
self.client_scope_ref
impl From<ClientScopeRef> for String {
fn from(val: ClientScopeRef) -> Self {
val.client_scope_ref
}
}
#[derive(Clone, Debug, Deserialize, Serialize, JsonSchema)]
#[serde(rename_all = "camelCase")]
pub struct RealmRef {
pub realm_ref: String,
}
impl Into<String> for RealmRef {
fn into(self) -> String {
self.realm_ref
impl From<RealmRef> for String {
fn from(val: RealmRef) -> Self {
val.realm_ref
}
}
4 changes: 1 addition & 3 deletions src/endpoint/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@ where
}

fn endpoint_path(&self) -> Option<String> {
let Some(up_resource_path) = self.up.resource_path() else {
return None;
};
let up_resource_path = self.up.resource_path()?;
Some(format!("{}/{}", up_resource_path, self.value.mount_point()))
}

Expand Down

0 comments on commit 28f092d

Please sign in to comment.