mirror of
https://git.meli.delivery/meli/meli
synced 2024-11-19 03:25:38 +00:00
Fix clippy lints
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
This commit is contained in:
parent
0e60bdf26e
commit
688e39a67e
@ -78,7 +78,7 @@ impl std::fmt::Display for JobManager {
|
||||
}
|
||||
|
||||
impl JobManager {
|
||||
const HEADERS: [&str; 5] = ["id", "desc", "started", "finished", "succeeded"];
|
||||
const HEADERS: [&'static str; 5] = ["id", "desc", "started", "finished", "succeeded"];
|
||||
|
||||
pub fn new(context: &Context) -> Self {
|
||||
let theme_default = crate::conf::value(context, "theme_default");
|
||||
|
@ -1899,7 +1899,7 @@ impl Component for Composer {
|
||||
);
|
||||
|
||||
let f = create_temp_file(
|
||||
self.draft.to_edit_string().as_str().as_bytes(),
|
||||
self.draft.to_edit_string().as_bytes(),
|
||||
None,
|
||||
None,
|
||||
Some("eml"),
|
||||
|
@ -57,7 +57,7 @@ pub fn edit_config() -> Result<()> {
|
||||
})?;
|
||||
let config_path = crate::conf::get_config_file()?;
|
||||
|
||||
let mut cmd = Command::new(&editor);
|
||||
let mut cmd = Command::new(editor);
|
||||
|
||||
let mut handle = &mut cmd;
|
||||
for c in crate::conf::get_included_configs(config_path)? {
|
||||
|
@ -265,7 +265,7 @@ impl EmbedGrid {
|
||||
ref mut scroll_region,
|
||||
ref mut terminal_size,
|
||||
ref mut alternate_screen,
|
||||
ref mut state,
|
||||
state: _,
|
||||
ref mut fg_color,
|
||||
ref mut bg_color,
|
||||
ref mut attrs,
|
||||
@ -347,8 +347,7 @@ impl EmbedGrid {
|
||||
};
|
||||
}
|
||||
|
||||
#[allow(clippy::redundant_locals)]
|
||||
let mut state = state;
|
||||
let mut state = &mut self.state;
|
||||
match (byte, &mut state) {
|
||||
(b'\x1b', State::Normal) => {
|
||||
*state = State::ExpectingControlChar;
|
||||
|
@ -158,10 +158,10 @@ impl<const N: usize> Default for DataColumns<N> {
|
||||
}
|
||||
|
||||
impl<const N: usize> DataColumns<N> {
|
||||
pub const ARROW_UP: &str = "🠉";
|
||||
pub const ARROW_DOWN: &str = "🠋";
|
||||
pub const ARROW_UP_ASCII: &str = "^";
|
||||
pub const ARROW_DOWN_ASCII: &str = "v";
|
||||
pub const ARROW_UP: &'static str = "🠉";
|
||||
pub const ARROW_DOWN: &'static str = "🠋";
|
||||
pub const ARROW_UP_ASCII: &'static str = "^";
|
||||
pub const ARROW_DOWN_ASCII: &'static str = "v";
|
||||
// const ARROW_UP_1: &str = "↑";
|
||||
// const ARROW_DOWN_1: &str = "↓";
|
||||
// const ARROW_UP_3: &str = "▲";
|
||||
|
@ -40,7 +40,7 @@ pub struct Mailto {
|
||||
}
|
||||
|
||||
impl Mailto {
|
||||
pub const IGNORE_HEADERS: &[HeaderName] = &[
|
||||
pub const IGNORE_HEADERS: &'static [HeaderName] = &[
|
||||
HeaderName::FROM,
|
||||
HeaderName::DATE,
|
||||
HeaderName::MESSAGE_ID,
|
||||
@ -97,7 +97,7 @@ impl Mailto {
|
||||
HeaderName::USER_AGENT,
|
||||
];
|
||||
|
||||
pub const MAILTO_CHARSET: &AsciiSet = &CONTROLS
|
||||
pub const MAILTO_CHARSET: &'static AsciiSet = &CONTROLS
|
||||
.add(b' ')
|
||||
.add(b'"')
|
||||
.add(b'"')
|
||||
|
@ -1188,12 +1188,8 @@ unsafe impl Sync for Data {}
|
||||
impl Drop for Data {
|
||||
#[inline]
|
||||
fn drop(&mut self) {
|
||||
if !self.inner.as_ptr().is_null() {
|
||||
match self.kind {
|
||||
DataKind::Memory => unsafe {
|
||||
call!(self.lib, gpgme_data_release)(self.inner.as_mut())
|
||||
},
|
||||
}
|
||||
match self.kind {
|
||||
DataKind::Memory => unsafe { call!(self.lib, gpgme_data_release)(self.inner.as_mut()) },
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -975,7 +975,7 @@ impl MailBackend for ImapType {
|
||||
}
|
||||
let ret: Result<()> = ImapResponse::try_from(response.as_slice())?.into();
|
||||
ret?;
|
||||
let new_hash = MailboxHash::from_bytes(path.as_str().as_bytes());
|
||||
let new_hash = MailboxHash::from_bytes(path.as_bytes());
|
||||
uid_store.mailboxes.lock().await.clear();
|
||||
Ok((
|
||||
new_hash,
|
||||
@ -1141,7 +1141,7 @@ impl MailBackend for ImapType {
|
||||
.read_response(&mut response, RequiredResponses::empty())
|
||||
.await?;
|
||||
}
|
||||
let new_hash = MailboxHash::from_bytes(new_path.as_str().as_bytes());
|
||||
let new_hash = MailboxHash::from_bytes(new_path.as_bytes());
|
||||
let ret: Result<()> = ImapResponse::try_from(response.as_slice())?.into();
|
||||
ret?;
|
||||
uid_store.mailboxes.lock().await.clear();
|
||||
|
@ -61,8 +61,8 @@ pub mod html_escape {
|
||||
}
|
||||
|
||||
impl HtmlEntity {
|
||||
pub const ALL: [&str; 4] = ["<", ">", "&", """];
|
||||
pub const GLYPHS: [&str; 4] = ["<", ">", "&", "\""];
|
||||
pub const ALL: [&'static str; 4] = ["<", ">", "&", """];
|
||||
pub const GLYPHS: [&'static str; 4] = ["<", ">", "&", "\""];
|
||||
|
||||
pub const fn glyph(self) -> char {
|
||||
match self {
|
||||
|
Loading…
Reference in New Issue
Block a user