melib: update to 2021 edition

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
feature/sieve
Manos Pitsidianakis 9 months ago
parent 81974311c2
commit fe0a96f085
No known key found for this signature in database
GPG Key ID: 7729C7707F7E09D0

@ -1,4 +1,5 @@
[workspace] [workspace]
resolver = "2"
members = [ members = [
"meli", "meli",

@ -2,7 +2,7 @@
name = "melib" name = "melib"
version = "0.8.0" version = "0.8.0"
authors = ["Manos Pitsidianakis <manos@pitsidianak.is>"] authors = ["Manos Pitsidianakis <manos@pitsidianak.is>"]
edition = "2018" edition = "2021"
build = "build.rs" build = "build.rs"
rust-version = "1.65.0" rust-version = "1.65.0"

@ -149,7 +149,6 @@ impl Write for Data {
impl Seek for Data { impl Seek for Data {
#[inline] #[inline]
fn seek(&mut self, pos: io::SeekFrom) -> io::Result<u64> { fn seek(&mut self, pos: io::SeekFrom) -> io::Result<u64> {
use std::convert::TryInto;
let (off, whence) = match pos { let (off, whence) = match pos {
io::SeekFrom::Start(off) => (off.try_into().unwrap_or(i64::MAX), libc::SEEK_SET), io::SeekFrom::Start(off) => (off.try_into().unwrap_or(i64::MAX), libc::SEEK_SET),
io::SeekFrom::End(off) => (off.saturating_abs(), libc::SEEK_END), io::SeekFrom::End(off) => (off.saturating_abs(), libc::SEEK_END),

@ -1216,7 +1216,6 @@ impl MailBackend for ImapType {
for l in response.split_rn() { for l in response.split_rn() {
if l.starts_with(b"* SEARCH") { if l.starts_with(b"* SEARCH") {
use std::iter::FromIterator;
let uid_index = uid_store.uid_index.lock()?; let uid_index = uid_store.uid_index.lock()?;
return Ok(SmallVec::from_iter( return Ok(SmallVec::from_iter(
String::from_utf8_lossy(l[b"* SEARCH".len()..].trim()) String::from_utf8_lossy(l[b"* SEARCH".len()..].trim())

@ -1091,7 +1091,6 @@ pub fn split_lines_reflow(text: &str, reflow: Reflow, width: Option<usize>) -> V
continue; continue;
} }
let segment_tree = { let segment_tree = {
use std::iter::FromIterator;
let mut t: smallvec::SmallVec<[usize; 1024]> = let mut t: smallvec::SmallVec<[usize; 1024]> =
smallvec::SmallVec::from_iter(std::iter::repeat(0).take(line.len())); smallvec::SmallVec::from_iter(std::iter::repeat(0).take(line.len()));
for (idx, _g) in UnicodeSegmentation::grapheme_indices(line, true) { for (idx, _g) in UnicodeSegmentation::grapheme_indices(line, true) {
@ -1568,7 +1567,6 @@ impl Iterator for LineBreakText {
), ),
prev_break: 0, prev_break: 0,
segment_tree: { segment_tree: {
use std::iter::FromIterator;
let mut t: smallvec::SmallVec<[usize; 1024]> = let mut t: smallvec::SmallVec<[usize; 1024]> =
smallvec::SmallVec::from_iter( smallvec::SmallVec::from_iter(
std::iter::repeat(0).take(line.len()), std::iter::repeat(0).take(line.len()),

@ -69,7 +69,7 @@ impl ShellExpandTrait for Path {
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
fn complete(&self, force: bool) -> SmallVec<[String; 128]> { 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 libc::dirent64;
use nix::fcntl::OFlag; use nix::fcntl::OFlag;

Loading…
Cancel
Save