From fe0a96f0855486207280430064a93cab94dffeb2 Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Wed, 13 Sep 2023 18:47:00 +0300 Subject: [PATCH] melib: update to 2021 edition Signed-off-by: Manos Pitsidianakis --- Cargo.toml | 1 + melib/Cargo.toml | 2 +- melib/src/gpgme/io.rs | 1 - melib/src/imap/mod.rs | 1 - melib/src/text_processing/line_break.rs | 2 -- melib/src/utils/shellexpand.rs | 2 +- 6 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c5edee9c..8983fa67 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,4 +1,5 @@ [workspace] +resolver = "2" members = [ "meli", diff --git a/melib/Cargo.toml b/melib/Cargo.toml index c21ee154..625a2853 100644 --- a/melib/Cargo.toml +++ b/melib/Cargo.toml @@ -2,7 +2,7 @@ name = "melib" version = "0.8.0" authors = ["Manos Pitsidianakis "] -edition = "2018" +edition = "2021" build = "build.rs" rust-version = "1.65.0" diff --git a/melib/src/gpgme/io.rs b/melib/src/gpgme/io.rs index 987867fe..aa7ed8e1 100644 --- a/melib/src/gpgme/io.rs +++ b/melib/src/gpgme/io.rs @@ -149,7 +149,6 @@ impl Write for Data { impl Seek for Data { #[inline] fn seek(&mut self, pos: io::SeekFrom) -> io::Result { - use std::convert::TryInto; let (off, whence) = match pos { io::SeekFrom::Start(off) => (off.try_into().unwrap_or(i64::MAX), libc::SEEK_SET), io::SeekFrom::End(off) => (off.saturating_abs(), libc::SEEK_END), diff --git a/melib/src/imap/mod.rs b/melib/src/imap/mod.rs index 93a79804..a24eb9b0 100644 --- a/melib/src/imap/mod.rs +++ b/melib/src/imap/mod.rs @@ -1216,7 +1216,6 @@ impl MailBackend for ImapType { for l in response.split_rn() { if l.starts_with(b"* SEARCH") { - use std::iter::FromIterator; let uid_index = uid_store.uid_index.lock()?; return Ok(SmallVec::from_iter( String::from_utf8_lossy(l[b"* SEARCH".len()..].trim()) diff --git a/melib/src/text_processing/line_break.rs b/melib/src/text_processing/line_break.rs index 9283c009..a52705cc 100644 --- a/melib/src/text_processing/line_break.rs +++ b/melib/src/text_processing/line_break.rs @@ -1091,7 +1091,6 @@ pub fn split_lines_reflow(text: &str, reflow: Reflow, width: Option) -> V continue; } let segment_tree = { - use std::iter::FromIterator; let mut t: smallvec::SmallVec<[usize; 1024]> = smallvec::SmallVec::from_iter(std::iter::repeat(0).take(line.len())); for (idx, _g) in UnicodeSegmentation::grapheme_indices(line, true) { @@ -1568,7 +1567,6 @@ impl Iterator for LineBreakText { ), prev_break: 0, segment_tree: { - use std::iter::FromIterator; let mut t: smallvec::SmallVec<[usize; 1024]> = smallvec::SmallVec::from_iter( std::iter::repeat(0).take(line.len()), diff --git a/melib/src/utils/shellexpand.rs b/melib/src/utils/shellexpand.rs index 4697e541..623505f0 100644 --- a/melib/src/utils/shellexpand.rs +++ b/melib/src/utils/shellexpand.rs @@ -69,7 +69,7 @@ impl ShellExpandTrait for Path { #[cfg(target_os = "linux")] fn complete(&self, force: bool) -> SmallVec<[String; 128]> { - use std::{convert::TryFrom, os::unix::io::AsRawFd}; + use std::os::unix::io::AsRawFd; use libc::dirent64; use nix::fcntl::OFlag;