Skip to content

trick rustfmt to make things not less readable #1841

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 10 additions & 34 deletions src/sql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1296,44 +1296,20 @@ async fn open(
.await
{
let imap_socket_flags = server_flags & 0x700;
let imap_security_key = format!("{}mail_security", prefix);
let key = format!("{}mail_security", prefix);
match imap_socket_flags {
0x100 => {
sql.set_raw_config_int(context, imap_security_key, 2)
.await?
} // STARTTLS
0x200 => {
sql.set_raw_config_int(context, imap_security_key, 1)
.await?
} // SSL/TLS
0x400 => {
sql.set_raw_config_int(context, imap_security_key, 3)
.await?
} // Plain
_ => {
sql.set_raw_config_int(context, imap_security_key, 0)
.await?
}
0x100 => sql.set_raw_config_int(context, key, 2).await?, // STARTTLS
0x200 => sql.set_raw_config_int(context, key, 1).await?, // SSL/TLS
0x400 => sql.set_raw_config_int(context, key, 3).await?, // Plain
_ => sql.set_raw_config_int(context, key, 0).await?,
}
let smtp_socket_flags = server_flags & 0x70000;
let smtp_security_key = format!("{}send_security", prefix);
let key = format!("{}send_security", prefix);
match smtp_socket_flags {
0x10000 => {
sql.set_raw_config_int(context, smtp_security_key, 2)
.await?
} // STARTTLS
0x20000 => {
sql.set_raw_config_int(context, smtp_security_key, 1)
.await?
} // SSL/TLS
0x40000 => {
sql.set_raw_config_int(context, smtp_security_key, 3)
.await?
} // Plain
_ => {
sql.set_raw_config_int(context, smtp_security_key, 0)
.await?
}
0x10000 => sql.set_raw_config_int(context, key, 2).await?, // STARTTLS
0x20000 => sql.set_raw_config_int(context, key, 1).await?, // SSL/TLS
0x40000 => sql.set_raw_config_int(context, key, 3).await?, // Plain
_ => sql.set_raw_config_int(context, key, 0).await?,
}
}
}
Expand Down