Skip to content

Commit

Permalink
chore: fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
marverlous811 committed Nov 30, 2024
1 parent 315bded commit e8d9d8c
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
4 changes: 1 addition & 3 deletions bin/admin-panel/src/http/api/workspace/invites.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ pub async fn invite(
let invite = create_workspace_member_invite(
data.db.clone(),
crate::database::repositories::workspace_invite::WorkspaceMembersInviteCreate {
workspace_id: workspace_id,
workspace_id,
email: body.email.clone(),
expires,
},
Expand Down Expand Up @@ -125,7 +125,6 @@ pub async fn accept_invite(
workspace_id: Some(params.workspace_id.clone()),
email: Some(email.clone()),
id: Some(params.invite_id),
..Default::default()
},
)
.await?;

Check warning on line 130 in bin/admin-panel/src/http/api/workspace/invites.rs

View check run for this annotation

Codecov / codecov/patch

bin/admin-panel/src/http/api/workspace/invites.rs#L114-L130

Added lines #L114 - L130 were not covered by tests
Expand Down Expand Up @@ -176,7 +175,6 @@ pub async fn decline_invite(
workspace_id: Some(params.workspace_id.clone()),
email: Some(email.clone()),
id: Some(params.invite_id),
..Default::default()
},
)
.await?;

Check warning on line 180 in bin/admin-panel/src/http/api/workspace/invites.rs

View check run for this annotation

Codecov / codecov/patch

bin/admin-panel/src/http/api/workspace/invites.rs#L164-L180

Added lines #L164 - L180 were not covered by tests
Expand Down
2 changes: 1 addition & 1 deletion bin/admin-panel/src/http/middleware/clerk_auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub struct RequestWrapper<'a> {
pub req: &'a Request,
}

impl<'a> ClerkRequest for RequestWrapper<'a> {
impl ClerkRequest for RequestWrapper<'_> {
fn get_header(&self, key: &str) -> Option<String> {
self.req
.headers()
Expand Down
4 changes: 2 additions & 2 deletions bin/admin-panel/src/http/middleware/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ impl<E: Endpoint> Endpoint for WorkspaceMiddlewareImpl<E> {
}
Err(err) => {
log::error!("Error: {:?}", err);
return Err(Error::from_string(
Err(Error::from_string(
"internal server error",
StatusCode::INTERNAL_SERVER_ERROR,
));
))

Check warning on line 86 in bin/admin-panel/src/http/middleware/workspace.rs

View check run for this annotation

Codecov / codecov/patch

bin/admin-panel/src/http/middleware/workspace.rs#L81-L86

Added lines #L81 - L86 were not covered by tests
}
}
}

Check warning on line 89 in bin/admin-panel/src/http/middleware/workspace.rs

View check run for this annotation

Codecov / codecov/patch

bin/admin-panel/src/http/middleware/workspace.rs#L89

Added line #L89 was not covered by tests
Expand Down
1 change: 1 addition & 0 deletions bin/admin-panel/src/http/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pub fn build_frontend_route() -> Route {
.finish(); // Finishes constructing the configuration

log::info!("Running in development mode, starting Vite dev server...");
#[allow(clippy::zombie_processes)]
std::process::Command::new("pnpm")
.current_dir("./view/")
.args(["run", "dev"])
Expand Down
2 changes: 1 addition & 1 deletion bin/admin-panel/src/services/clerk_user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl ClerkUserService {
match user {
Some(user) => match user.email_addresses {
Some(emails) => {
if emails.len() > 0 {
if !emails.is_empty() {
Ok(emails[0].email_address.clone())

Check warning on line 55 in bin/admin-panel/src/services/clerk_user.rs

View check run for this annotation

Codecov / codecov/patch

bin/admin-panel/src/services/clerk_user.rs#L49-L55

Added lines #L49 - L55 were not covered by tests
} else {
anyhow::bail!("User has no email addresses")

Check warning on line 57 in bin/admin-panel/src/services/clerk_user.rs

View check run for this annotation

Codecov / codecov/patch

bin/admin-panel/src/services/clerk_user.rs#L57

Added line #L57 was not covered by tests
Expand Down

0 comments on commit e8d9d8c

Please sign in to comment.