fix many clones()

This commit is contained in:
2023-05-24 12:11:55 +02:00
parent cf45036642
commit 99296d4060
8 changed files with 54 additions and 71 deletions

View File

@@ -86,18 +86,18 @@ async fn update(
}
#[derive(FromForm)]
struct UserAddForm {
name: String,
struct UserAddForm<'r> {
name: &'r str,
is_guest: bool,
}
#[post("/user/new", data = "<data>")]
async fn create(
db: &State<SqlitePool>,
data: Form<UserAddForm>,
data: Form<UserAddForm<'_>>,
_admin: AdminUser,
) -> Flash<Redirect> {
if User::create(db, data.name.clone(), data.is_guest).await {
if User::create(db, data.name, data.is_guest).await {
//TODO: fix clone() above
Flash::success(Redirect::to("/admin/user"), "Successfully created user")
} else {