Author: Manos Pitsidianakis [manos@pitsidianak.is]
Hash: fe0a96f0855486207280430064a93cab94dffeb2
Timestamp: Wed, 13 Sep 2023 15:47:00 +0000 (1 year ago)

+3 -6 +/-6 browse
melib: update to 2021 edition
melib: update to 2021 edition

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
1diff --git a/Cargo.toml b/Cargo.toml
2index c5edee9..8983fa6 100644
3--- a/Cargo.toml
4+++ b/Cargo.toml
5 @@ -1,4 +1,5 @@
6 [workspace]
7+ resolver = "2"
8
9 members = [
10 "meli",
11 diff --git a/melib/Cargo.toml b/melib/Cargo.toml
12index c21ee15..625a285 100644
13--- a/melib/Cargo.toml
14+++ b/melib/Cargo.toml
15 @@ -2,7 +2,7 @@
16 name = "melib"
17 version = "0.8.0"
18 authors = ["Manos Pitsidianakis <manos@pitsidianak.is>"]
19- edition = "2018"
20+ edition = "2021"
21 build = "build.rs"
22 rust-version = "1.65.0"
23
24 diff --git a/melib/src/gpgme/io.rs b/melib/src/gpgme/io.rs
25index 987867f..aa7ed8e 100644
26--- a/melib/src/gpgme/io.rs
27+++ b/melib/src/gpgme/io.rs
28 @@ -149,7 +149,6 @@ impl Write for Data {
29 impl Seek for Data {
30 #[inline]
31 fn seek(&mut self, pos: io::SeekFrom) -> io::Result<u64> {
32- use std::convert::TryInto;
33 let (off, whence) = match pos {
34 io::SeekFrom::Start(off) => (off.try_into().unwrap_or(i64::MAX), libc::SEEK_SET),
35 io::SeekFrom::End(off) => (off.saturating_abs(), libc::SEEK_END),
36 diff --git a/melib/src/imap/mod.rs b/melib/src/imap/mod.rs
37index 93a7980..a24eb9b 100644
38--- a/melib/src/imap/mod.rs
39+++ b/melib/src/imap/mod.rs
40 @@ -1216,7 +1216,6 @@ impl MailBackend for ImapType {
41
42 for l in response.split_rn() {
43 if l.starts_with(b"* SEARCH") {
44- use std::iter::FromIterator;
45 let uid_index = uid_store.uid_index.lock()?;
46 return Ok(SmallVec::from_iter(
47 String::from_utf8_lossy(l[b"* SEARCH".len()..].trim())
48 diff --git a/melib/src/text_processing/line_break.rs b/melib/src/text_processing/line_break.rs
49index 9283c00..a52705c 100644
50--- a/melib/src/text_processing/line_break.rs
51+++ b/melib/src/text_processing/line_break.rs
52 @@ -1091,7 +1091,6 @@ pub fn split_lines_reflow(text: &str, reflow: Reflow, width: Option<usize>) -> V
53 continue;
54 }
55 let segment_tree = {
56- use std::iter::FromIterator;
57 let mut t: smallvec::SmallVec<[usize; 1024]> =
58 smallvec::SmallVec::from_iter(std::iter::repeat(0).take(line.len()));
59 for (idx, _g) in UnicodeSegmentation::grapheme_indices(line, true) {
60 @@ -1568,7 +1567,6 @@ impl Iterator for LineBreakText {
61 ),
62 prev_break: 0,
63 segment_tree: {
64- use std::iter::FromIterator;
65 let mut t: smallvec::SmallVec<[usize; 1024]> =
66 smallvec::SmallVec::from_iter(
67 std::iter::repeat(0).take(line.len()),
68 diff --git a/melib/src/utils/shellexpand.rs b/melib/src/utils/shellexpand.rs
69index 4697e54..623505f 100644
70--- a/melib/src/utils/shellexpand.rs
71+++ b/melib/src/utils/shellexpand.rs
72 @@ -69,7 +69,7 @@ impl ShellExpandTrait for Path {
73
74 #[cfg(target_os = "linux")]
75 fn complete(&self, force: bool) -> SmallVec<[String; 128]> {
76- use std::{convert::TryFrom, os::unix::io::AsRawFd};
77+ use std::os::unix::io::AsRawFd;
78
79 use libc::dirent64;
80 use nix::fcntl::OFlag;