Fix cargo clippy and doc errors after Rust update to 1.66

This commit is contained in:
iequidoo
2022-12-15 17:31:57 -03:00
committed by iequidoo
parent 2cd63234c1
commit c3a0bb2b77
15 changed files with 37 additions and 46 deletions

View File

@@ -273,7 +273,7 @@ async fn maybe_warn_on_outdated(context: &Context, now: i64, approx_compile_time
/// IDs generated by this function are 66 bit wide and are returned as 11 base64 characters.
///
/// Additional information when used as a message-id or group-id:
/// - for OUTGOING messages this ID is written to the header as `Chat-Group-ID:` and is added to the message ID as Gr.<grpid>.<random>@<random>
/// - for OUTGOING messages this ID is written to the header as `Chat-Group-ID:` and is added to the message ID as `Gr.<grpid>.<random>@<random>`
/// - for INCOMING messages, the ID is taken from the Chat-Group-ID-header or from the Message-ID in the In-Reply-To: or References:-Header
/// - the group-id should be a string with the characters [a-zA-Z0-9\-_]
pub(crate) fn create_id() -> String {
@@ -361,7 +361,7 @@ pub(crate) fn get_abs_path(context: &Context, path: impl AsRef<Path>) -> PathBuf
pub(crate) async fn get_filebytes(context: &Context, path: impl AsRef<Path>) -> u64 {
let path_abs = get_abs_path(context, &path);
match fs::metadata(&path_abs).await {
Ok(meta) => meta.len() as u64,
Ok(meta) => meta.len(),
Err(_err) => 0,
}
}
@@ -494,7 +494,7 @@ pub fn open_file_std<P: AsRef<std::path::Path>>(
let p: PathBuf = path.as_ref().into();
let path_abs = get_abs_path(context, p);
match std::fs::File::open(&path_abs) {
match std::fs::File::open(path_abs) {
Ok(bytes) => Ok(bytes),
Err(err) => {
warn!(