clippy: fix new warnings for 1.78.0

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
pull/384/head
Manos Pitsidianakis 4 weeks ago
parent 36b7c00b97
commit ab04189887
No known key found for this signature in database
GPG Key ID: 7729C7707F7E09D0

@ -610,7 +610,7 @@ impl Settings {
for (id, x) in fs.accounts { for (id, x) in fs.accounts {
let mut ac = AccountConf::from(x); let mut ac = AccountConf::from(x);
ac.account.name = id.clone(); ac.account.name.clone_from(&id);
s.insert(id, ac); s.insert(id, ac);
} }

@ -717,7 +717,7 @@ impl Component for StatusBar {
self.dirty = true; self.dirty = true;
} }
UIEvent::StatusEvent(StatusEvent::BufSet(s)) => { UIEvent::StatusEvent(StatusEvent::BufSet(s)) => {
self.display_buffer = s.clone(); self.display_buffer.clone_from(s);
self.dirty = true; self.dirty = true;
} }
UIEvent::StatusEvent(StatusEvent::UpdateStatus(ref mut s)) => { UIEvent::StatusEvent(StatusEvent::UpdateStatus(ref mut s)) => {

@ -70,7 +70,7 @@ pub fn parse_mutt_contact<'a>() -> impl Parser<'a, Card> {
}); });
name.pop(); name.pop();
if name.trim().is_empty() { if name.trim().is_empty() {
name = title.clone(); name.clone_from(&title);
} }
ret.set_title(title).set_email(email).set_name(name); ret.set_title(title).set_email(email).set_name(name);
Ok::<Card, &'a str>(ret) Ok::<Card, &'a str>(ret)

@ -106,17 +106,18 @@ impl std::fmt::Debug for ParsingError<&'_ str> {
} }
} }
struct DebugOkWrapper<'r, I, R: AsRef<[u8]>>(&'r IResult<I, R>); // For debugging.
// struct DebugOkWrapper<'r, I, R: AsRef<[u8]>>(&'r IResult<I, R>);
impl<R: AsRef<[u8]> + std::fmt::Debug> std::fmt::Debug for DebugOkWrapper<'_, &'_ [u8], R> {
fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result { // impl<R: AsRef<[u8]> + std::fmt::Debug> std::fmt::Debug for DebugOkWrapper<'_,
if let Ok((a, b)) = self.0 { // &'_ [u8], R> { fn fmt(&self, fmt: &mut std::fmt::Formatter) ->
write!(fmt, "Ok({}, {})", &to_str!(a), &to_str!(b.as_ref())) // std::fmt::Result { if let Ok((a, b)) = self.0 {
} else { // write!(fmt, "Ok({}, {})", &to_str!(a), &to_str!(b.as_ref()))
write!(fmt, "{:?}", self.0) // } else {
} // write!(fmt, "{:?}", self.0)
} // }
} // }
// }
pub type IResult<I, O, E = ParsingError<I>> = std::result::Result<(I, O), nom::Err<E>>; pub type IResult<I, O, E = ParsingError<I>> = std::result::Result<(I, O), nom::Err<E>>;
@ -2156,7 +2157,7 @@ pub mod encodings {
let s: Vec<u8> = match input[tag_end_idx + 1] { let s: Vec<u8> = match input[tag_end_idx + 1] {
b'b' | b'B' => BASE64_MIME b'b' | b'B' => BASE64_MIME
.decode(encoded_text) .decode(encoded_text)
.map_or_else(|_| encoded_text.to_vec(), |v| v), .unwrap_or_else(|_| encoded_text.to_vec()),
b'q' | b'Q' => match quoted_printable_bytes_header(encoded_text) { b'q' | b'Q' => match quoted_printable_bytes_header(encoded_text) {
Ok((b"", s)) => s, Ok((b"", s)) => s,
_ => { _ => {

@ -229,7 +229,11 @@ impl JmapConnection {
return Err(err); return Err(err);
} }
*self.store.core_capabilities.lock().unwrap() = session.capabilities.clone(); self.store
.core_capabilities
.lock()
.unwrap()
.clone_from(&session.capabilities);
let mail_account_id = session.mail_account_id(); let mail_account_id = session.mail_account_id();
_ = self _ = self
.store .store

@ -1480,28 +1480,28 @@ fn print_threadnodes(
} }
*/ */
#[derive(Serialize)] // #[derive(Serialize)]
struct Node { // struct Node {
id: String, // id: String,
subject: String, // subject: String,
from: String, // from: String,
to: String, // to: String,
date: UnixTimestamp, // date: UnixTimestamp,
references: String, // references: String,
in_reply_to: String, // in_reply_to: String,
} // }
#[derive(Serialize)] // #[derive(Serialize)]
struct Link { // struct Link {
source: String, // source: String,
target: String, // target: String,
} // }
#[derive(Serialize)] // #[derive(Serialize)]
struct Graph { // struct Graph {
nodes: Vec<Node>, // nodes: Vec<Node>,
links: Vec<Link>, // links: Vec<Link>,
} // }
/* /*
fn save_graph( fn save_graph(

Loading…
Cancel
Save