Skip to content

Commit

Permalink
Merge pull request dani-garcia#3981 from teicee/3980-unnecessary-copy
Browse files Browse the repository at this point in the history
Remove unnecessary variable clone
  • Loading branch information
dani-garcia authored and jayknyn committed Oct 28, 2023
2 parents e6ae360 + 5dde853 commit 92fb971
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/api/admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,12 +279,11 @@ async fn get_user_or_404(uuid: &str, conn: &mut DbConn) -> ApiResult<User> {
#[post("/invite", data = "<data>")]
async fn invite_user(data: Json<InviteData>, _token: AdminToken, mut conn: DbConn) -> JsonResult {
let data: InviteData = data.into_inner();
let email = data.email.clone();
if User::find_by_mail(&data.email, &mut conn).await.is_some() {
err_code!("User already exists", Status::Conflict.code)
}

let mut user = User::new(email);
let mut user = User::new(data.email);

async fn _generate_invite(user: &User, conn: &mut DbConn) -> EmptyResult {
if CONFIG.mail_enabled() {
Expand Down

0 comments on commit 92fb971

Please sign in to comment.