cargo fmt + clippy

This commit is contained in:
2024-08-06 23:48:31 +02:00
parent fb7391a29c
commit 21c2fc2e8b
7 changed files with 30 additions and 24 deletions

View File

@@ -11,7 +11,8 @@ use crate::core::{
database_operations::{
apply_permission_diffs, db_priv_field_human_readable_name, diff_permissions, yn,
DatabasePrivileges, DATABASE_PRIVILEGE_FIELDS,
}, user_operations::user_exists,
},
user_operations::user_exists,
};
// TODO: Support batch creation/dropping,showing of databases,
@@ -520,10 +521,10 @@ pub async fn edit_permissions(
};
for row in permissions_to_change.iter() {
if !user_exists(&row.user, conn).await? {
// TODO: allow user to return and correct their mistake
anyhow::bail!("User {} does not exist", row.user);
}
if !user_exists(&row.user, conn).await? {
// TODO: allow user to return and correct their mistake
anyhow::bail!("User {} does not exist", row.user);
}
}
let diffs = diff_permissions(permission_data, &permissions_to_change).await;

View File

@@ -1,3 +1,3 @@
pub mod common;
pub mod mysql_dbadm;
pub mod mysql_useradm;
pub mod mysql_useradm;

View File

@@ -54,12 +54,7 @@ pub struct Args {
/// This is a compatibility layer for the mysql-dbadm command.
/// Please consider using the newer mysqladm command instead.
#[derive(Parser)]
#[command(
version,
about,
disable_help_subcommand = true,
verbatim_doc_comment,
)]
#[command(version, about, disable_help_subcommand = true, verbatim_doc_comment)]
pub enum Command {
/// create the DATABASE(s).
Create(CreateArgs),
@@ -73,7 +68,6 @@ pub enum Command {
// TODO: make this output more verbatim_doc_comment-like,
// without messing up the indentation.
/// change permissions for the DATABASE(s). Your
/// favorite editor will be started, allowing you
/// to make changes to the permission table.