Skip to content

Commit

Permalink
[autofix.ci] apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored Dec 1, 2023
1 parent d9eac37 commit af14d00
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
3 changes: 2 additions & 1 deletion ee/tabby-webserver/src/service/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ impl AuthenticationService for DbConn {

let pwd_hash = password_hash(&input.password1)?;

let id = self.create_user(input.email.clone(), pwd_hash, !is_admin_initialized)
let id = self
.create_user(input.email.clone(), pwd_hash, !is_admin_initialized)
.await?;
let user = self.get_user(id).await?.unwrap();

Expand Down
12 changes: 5 additions & 7 deletions ee/tabby-webserver/src/service/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@ impl DbConn {
let res = self
.conn
.call(move |c| {
let mut stmt = c.prepare(r#"INSERT INTO users (email, password_encrypted, is_admin) VALUES (?, ?, ?)"#)?;
let mut stmt = c.prepare(
r#"INSERT INTO users (email, password_encrypted, is_admin) VALUES (?, ?, ?)"#,
)?;
let id = stmt.insert((email, password_encrypted, is_admin))?;
Ok(id)
})
Expand All @@ -187,12 +189,8 @@ impl DbConn {
let user = self
.conn
.call(move |c| {
c.query_row(
User::select("id = ?").as_str(),
params![id],
User::from_row,
)
.optional()
c.query_row(User::select("id = ?").as_str(), params![id], User::from_row)
.optional()
})
.await?;

Expand Down

0 comments on commit af14d00

Please sign in to comment.