Skip to content

Commit

Permalink
Fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
smrtrfszm committed Jul 5, 2024
1 parent bdee7a8 commit e792c5c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cmds/src/create_iam_app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ async fn main() {

let (id, secret) = create_app(&database, &name).await;

println!("id: {}", id.to_string());
println!("id: {}", id);
println!("secret: {}", secret);
}
2 changes: 1 addition & 1 deletion iam-common/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ where

apps::Entity::insert(app).exec(db).await?;

let secret = BASE64_STANDARD_NO_PAD.encode(format!("{}:{}", id.to_string(), password));
let secret = BASE64_STANDARD_NO_PAD.encode(format!("{}:{}", id, password));
Ok((id, secret))
}
9 changes: 5 additions & 4 deletions iam-common/src/id.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use once_cell::sync::Lazy;
use serde::{Deserialize, Serialize};
use std::fmt::{self, Display};
use uuid::{
v1::{Context, Timestamp},
Uuid,
Expand Down Expand Up @@ -81,10 +82,10 @@ impl Id {
}
}

impl ToString for Id {
#[inline]
fn to_string(&self) -> String {
format!(
impl Display for Id {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(
f,
"{}-{}",
self.get_prefix(),
self.uuid
Expand Down
2 changes: 1 addition & 1 deletion iam-migration/src/m20220822_190837_remove_invite_action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ impl MigrationTrait for Migration {
}

async fn down(&self, _manager: &SchemaManager) -> Result<(), DbErr> {
todo!();
Ok(())
}
}

Expand Down
2 changes: 1 addition & 1 deletion iam/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ fn audit_filter(metadata: &tracing::Metadata<'_>) -> bool {
if metadata.is_event() {
return metadata.target().starts_with("audit");
}
return metadata.name().starts_with("audit");
metadata.name().starts_with("audit")
}

#[tokio::main]
Expand Down

0 comments on commit e792c5c

Please sign in to comment.