melib: update to 2021 edition

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

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

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

@ -149,7 +149,6 @@ impl Write for Data {
impl Seek for Data {
#[inline]
fn seek(&mut self, pos: io::SeekFrom) -> io::Result<u64> {
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),

@ -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())

@ -1091,7 +1091,6 @@ pub fn split_lines_reflow(text: &str, reflow: Reflow, width: Option<usize>) -> 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()),

@ -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;

Loading…
Cancel
Save