mirror of
https://github.com/chatmail/core.git
synced 2026-05-05 22:36:30 +03:00
fix warnings and bugs, noticed on nightly
This commit is contained in:
committed by
holger krekel
parent
a7bf05bebb
commit
baff13ecab
@@ -285,7 +285,7 @@ pub unsafe extern "C" fn dc_start_io(context: *mut dc_context_t) {
|
|||||||
}
|
}
|
||||||
let ctx = &*context;
|
let ctx = &*context;
|
||||||
|
|
||||||
block_on({ ctx.start_io() })
|
block_on(ctx.start_io())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
@@ -295,7 +295,7 @@ pub unsafe extern "C" fn dc_is_io_running(context: *mut dc_context_t) -> libc::c
|
|||||||
}
|
}
|
||||||
let ctx = &*context;
|
let ctx = &*context;
|
||||||
|
|
||||||
block_on({ ctx.is_io_running() }) as libc::c_int
|
block_on(ctx.is_io_running()) as libc::c_int
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
@@ -1829,7 +1829,11 @@ pub unsafe extern "C" fn dc_send_locations_to_chat(
|
|||||||
}
|
}
|
||||||
let ctx = &*context;
|
let ctx = &*context;
|
||||||
|
|
||||||
block_on({ location::send_locations_to_chat(&ctx, ChatId::new(chat_id), seconds as i64) });
|
block_on(location::send_locations_to_chat(
|
||||||
|
&ctx,
|
||||||
|
ChatId::new(chat_id),
|
||||||
|
seconds as i64,
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
|
|||||||
@@ -811,7 +811,6 @@ impl Imap {
|
|||||||
Ok(_) => Some(server_uid),
|
Ok(_) => Some(server_uid),
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
warn!(context, "dc_receive_imf error: {}", err);
|
warn!(context, "dc_receive_imf error: {}", err);
|
||||||
read_errors += 1;
|
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -530,7 +530,7 @@ pub async fn save(
|
|||||||
accuracy,
|
accuracy,
|
||||||
..
|
..
|
||||||
} = location;
|
} = location;
|
||||||
context
|
let (loc_id, ts) = context
|
||||||
.sql
|
.sql
|
||||||
.with_conn(move |mut conn| {
|
.with_conn(move |mut conn| {
|
||||||
let mut stmt_test = conn
|
let mut stmt_test = conn
|
||||||
@@ -569,9 +569,11 @@ pub async fn save(
|
|||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok((newest_location_id, newest_timestamp))
|
||||||
})
|
})
|
||||||
.await?;
|
.await?;
|
||||||
|
newest_timestamp = ts;
|
||||||
|
newest_location_id = loc_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(newest_location_id)
|
Ok(newest_location_id)
|
||||||
|
|||||||
@@ -257,7 +257,8 @@ impl MimeMessage {
|
|||||||
self.parts[0].msg = "".to_string();
|
self.parts[0].msg = "".to_string();
|
||||||
|
|
||||||
// swap new with old
|
// swap new with old
|
||||||
std::mem::replace(&mut self.parts[0], filepart);
|
self.parts.push(filepart); // push to the end
|
||||||
|
let _ = self.parts.swap_remove(0); // drops first element, replacing it with the last one in O(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user