mirror of
https://github.com/chatmail/core.git
synced 2026-05-14 20:36:30 +03:00
Automatically fix some clippy warnings with "cargo fix"
This commit is contained in:
committed by
holger krekel
parent
fbb8c8e80c
commit
d0795f5770
@@ -132,10 +132,8 @@ fn poke_spec(context: &Context, spec: *const libc::c_char) -> libc::c_int {
|
|||||||
real_spec = rs.unwrap();
|
real_spec = rs.unwrap();
|
||||||
}
|
}
|
||||||
if let Some(suffix) = dc_get_filesuffix_lc(&real_spec) {
|
if let Some(suffix) = dc_get_filesuffix_lc(&real_spec) {
|
||||||
if suffix == "eml" {
|
if suffix == "eml" && dc_poke_eml_file(context, &real_spec).is_ok() {
|
||||||
if dc_poke_eml_file(context, &real_spec).is_ok() {
|
read_cnt += 1
|
||||||
read_cnt += 1
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* import a directory */
|
/* import a directory */
|
||||||
@@ -588,7 +586,7 @@ pub unsafe fn dc_cmdline(context: &Context, line: &str) -> Result<(), failure::E
|
|||||||
let members = chat::get_chat_contacts(context, sel_chat.id);
|
let members = chat::get_chat_contacts(context, sel_chat.id);
|
||||||
let subtitle = if sel_chat.is_device_talk() {
|
let subtitle = if sel_chat.is_device_talk() {
|
||||||
"device-talk".to_string()
|
"device-talk".to_string()
|
||||||
} else if sel_chat.get_type() == Chattype::Single && members.len() >= 1 {
|
} else if sel_chat.get_type() == Chattype::Single && !members.is_empty() {
|
||||||
let contact = Contact::get_by_id(context, members[0])?;
|
let contact = Contact::get_by_id(context, members[0])?;
|
||||||
contact.get_addr().to_string()
|
contact.get_addr().to_string()
|
||||||
} else {
|
} else {
|
||||||
@@ -862,11 +860,7 @@ pub unsafe fn dc_cmdline(context: &Context, line: &str) -> Result<(), failure::E
|
|||||||
"archive" | "unarchive" => {
|
"archive" | "unarchive" => {
|
||||||
ensure!(!arg1.is_empty(), "Argument <chat-id> missing.");
|
ensure!(!arg1.is_empty(), "Argument <chat-id> missing.");
|
||||||
let chat_id = arg1.parse()?;
|
let chat_id = arg1.parse()?;
|
||||||
chat::archive(
|
chat::archive(context, chat_id, arg0 == "archive")?;
|
||||||
context,
|
|
||||||
chat_id,
|
|
||||||
if arg0 == "archive" { true } else { false },
|
|
||||||
)?;
|
|
||||||
}
|
}
|
||||||
"delchat" => {
|
"delchat" => {
|
||||||
ensure!(!arg1.is_empty(), "Argument <chat-id> missing.");
|
ensure!(!arg1.is_empty(), "Argument <chat-id> missing.");
|
||||||
|
|||||||
@@ -235,7 +235,7 @@ impl Completer for DcHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const IMEX_COMMANDS: [&'static str; 12] = [
|
const IMEX_COMMANDS: [&str; 12] = [
|
||||||
"initiate-key-transfer",
|
"initiate-key-transfer",
|
||||||
"get-setupcodebegin",
|
"get-setupcodebegin",
|
||||||
"continue-key-transfer",
|
"continue-key-transfer",
|
||||||
@@ -250,7 +250,7 @@ const IMEX_COMMANDS: [&'static str; 12] = [
|
|||||||
"stop",
|
"stop",
|
||||||
];
|
];
|
||||||
|
|
||||||
const DB_COMMANDS: [&'static str; 11] = [
|
const DB_COMMANDS: [&str; 11] = [
|
||||||
"info",
|
"info",
|
||||||
"open",
|
"open",
|
||||||
"close",
|
"close",
|
||||||
@@ -264,7 +264,7 @@ const DB_COMMANDS: [&'static str; 11] = [
|
|||||||
"housekeeping",
|
"housekeeping",
|
||||||
];
|
];
|
||||||
|
|
||||||
const CHAT_COMMANDS: [&'static str; 24] = [
|
const CHAT_COMMANDS: [&str; 24] = [
|
||||||
"listchats",
|
"listchats",
|
||||||
"listarchived",
|
"listarchived",
|
||||||
"chat",
|
"chat",
|
||||||
@@ -290,7 +290,7 @@ const CHAT_COMMANDS: [&'static str; 24] = [
|
|||||||
"unarchive",
|
"unarchive",
|
||||||
"delchat",
|
"delchat",
|
||||||
];
|
];
|
||||||
const MESSAGE_COMMANDS: [&'static str; 8] = [
|
const MESSAGE_COMMANDS: [&str; 8] = [
|
||||||
"listmsgs",
|
"listmsgs",
|
||||||
"msginfo",
|
"msginfo",
|
||||||
"listfresh",
|
"listfresh",
|
||||||
@@ -300,7 +300,7 @@ const MESSAGE_COMMANDS: [&'static str; 8] = [
|
|||||||
"unstar",
|
"unstar",
|
||||||
"delmsg",
|
"delmsg",
|
||||||
];
|
];
|
||||||
const CONTACT_COMMANDS: [&'static str; 6] = [
|
const CONTACT_COMMANDS: [&str; 6] = [
|
||||||
"listcontacts",
|
"listcontacts",
|
||||||
"listverified",
|
"listverified",
|
||||||
"addcontact",
|
"addcontact",
|
||||||
@@ -308,7 +308,7 @@ const CONTACT_COMMANDS: [&'static str; 6] = [
|
|||||||
"delcontact",
|
"delcontact",
|
||||||
"cleanupcontacts",
|
"cleanupcontacts",
|
||||||
];
|
];
|
||||||
const MISC_COMMANDS: [&'static str; 9] = [
|
const MISC_COMMANDS: [&str; 9] = [
|
||||||
"getqr", "getbadqr", "checkqr", "event", "fileinfo", "clear", "exit", "quit", "help",
|
"getqr", "getbadqr", "checkqr", "event", "fileinfo", "clear", "exit", "quit", "help",
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -334,8 +334,8 @@ impl Hinter for DcHelper {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static COLORED_PROMPT: &'static str = "\x1b[1;32m> \x1b[0m";
|
static COLORED_PROMPT: &str = "\x1b[1;32m> \x1b[0m";
|
||||||
static PROMPT: &'static str = "> ";
|
static PROMPT: &str = "> ";
|
||||||
|
|
||||||
impl Highlighter for DcHelper {
|
impl Highlighter for DcHelper {
|
||||||
fn highlight_prompt<'p>(&self, prompt: &'p str) -> Cow<'p, str> {
|
fn highlight_prompt<'p>(&self, prompt: &'p str) -> Cow<'p, str> {
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ fn main() {
|
|||||||
|
|
||||||
println!("stopping threads");
|
println!("stopping threads");
|
||||||
|
|
||||||
*running.clone().write().unwrap() = false;
|
*running.write().unwrap() = false;
|
||||||
deltachat::job::interrupt_inbox_idle(&ctx, true);
|
deltachat::job::interrupt_inbox_idle(&ctx, true);
|
||||||
deltachat::job::interrupt_smtp_idle(&ctx);
|
deltachat::job::interrupt_smtp_idle(&ctx);
|
||||||
|
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ fn test_encryption_decryption() {
|
|||||||
public_keyring.add_ref(&public_key);
|
public_keyring.add_ref(&public_key);
|
||||||
|
|
||||||
let mut public_keyring2 = Keyring::default();
|
let mut public_keyring2 = Keyring::default();
|
||||||
public_keyring2.add_owned(public_key2.clone());
|
public_keyring2.add_owned(public_key2);
|
||||||
|
|
||||||
let mut valid_signatures: HashSet<String> = Default::default();
|
let mut valid_signatures: HashSet<String> = Default::default();
|
||||||
|
|
||||||
@@ -220,7 +220,7 @@ fn create_test_context() -> TestContext {
|
|||||||
let dir = tempdir().unwrap();
|
let dir = tempdir().unwrap();
|
||||||
let dbfile = dir.path().join("db.sqlite");
|
let dbfile = dir.path().join("db.sqlite");
|
||||||
let ctx = Context::new(Box::new(cb), "FakeOs".into(), dbfile).unwrap();
|
let ctx = Context::new(Box::new(cb), "FakeOs".into(), dbfile).unwrap();
|
||||||
TestContext { ctx: ctx, dir: dir }
|
TestContext { ctx, dir }
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
Reference in New Issue
Block a user