From 974b3a53058181e3df992a2105abcbf1c392fc19 Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Fri, 25 Aug 2023 08:17:05 +0300 Subject: [PATCH] Update bitflags, rusqlite dependencies Signed-off-by: Manos Pitsidianakis --- Cargo.lock | 17 ++++++++++------- meli/Cargo.toml | 2 +- meli/src/terminal/cells.rs | 1 + melib/Cargo.toml | 4 ++-- melib/src/email.rs | 2 +- melib/src/gpgme/mod.rs | 1 + melib/src/imap/protocol_parser.rs | 16 ++++++++-------- 7 files changed, 24 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0b3d328f..e454525d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -237,6 +237,9 @@ name = "bitflags" version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +dependencies = [ + "serde", +] [[package]] name = "block" @@ -1138,9 +1141,9 @@ dependencies = [ [[package]] name = "libsqlite3-sys" -version = "0.25.2" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29f835d03d717946d28b1d1ed632eb6f0e24a299388ee623d0c23118d3e8a7fa" +checksum = "afc22eff61b133b115c6e8c74e818c628d6d5e7a502afea6f64dee076dd94326" dependencies = [ "pkg-config", "vcpkg", @@ -1240,7 +1243,7 @@ name = "meli" version = "0.7.3" dependencies = [ "async-task", - "bitflags 1.3.2", + "bitflags 2.4.0", "crossbeam", "flate2", "futures", @@ -1278,7 +1281,7 @@ version = "0.8.0" dependencies = [ "async-stream", "base64 0.13.1", - "bitflags 1.3.2", + "bitflags 2.4.0", "data-encoding", "encoding", "encoding_rs", @@ -1809,11 +1812,11 @@ dependencies = [ [[package]] name = "rusqlite" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01e213bc3ecb39ac32e81e51ebe31fd888a940515173e3a18a35f8c6e896422a" +checksum = "549b9d036d571d42e6e85d1c1425e2ac83491075078ca9a15be021c56b1641f2" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.0", "fallible-iterator", "fallible-streaming-iterator", "hashlink", diff --git a/meli/Cargo.toml b/meli/Cargo.toml index 728b7e0e..284b9666 100644 --- a/meli/Cargo.toml +++ b/meli/Cargo.toml @@ -29,7 +29,7 @@ required-features = ["melib/imap"] [dependencies] async-task = "^4.2.0" -bitflags = "1.0" +bitflags = { version = "2.4", features = ["serde"] } crossbeam = { version = "^0.8" } flate2 = { version = "1", optional = true } futures = "0.3.5" diff --git a/meli/src/terminal/cells.rs b/meli/src/terminal/cells.rs index 12ba624e..41fa5ac2 100644 --- a/meli/src/terminal/cells.rs +++ b/meli/src/terminal/cells.rs @@ -755,6 +755,7 @@ bitflags::bitflags! { /// // Combination. /// let comb = Attr::UNDERLINE | Attr::REVERSE; /// ``` + #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct Attr: u8 { /// Terminal default. const DEFAULT = 0b000_0000; diff --git a/melib/Cargo.toml b/melib/Cargo.toml index 7c84416b..f23c344c 100644 --- a/melib/Cargo.toml +++ b/melib/Cargo.toml @@ -21,7 +21,7 @@ path = "src/lib.rs" [dependencies] async-stream = "^0.3" base64 = { version = "^0.13", optional = true } -bitflags = "1.0" +bitflags = { version = "2.4", features = ["serde"] } data-encoding = { version = "2.1.1" } encoding = { version = "0.2.33", default-features = false } encoding_rs = { version = "^0.8" } @@ -42,7 +42,7 @@ nom = { version = "7" } notify = { version = "4.0.15", optional = true } polling = "2.8" regex = { version = "1" } -rusqlite = { version = "^0.28", default-features = false, optional = true } +rusqlite = { version = "^0.29", default-features = false, optional = true } serde = { version = "1.0", features = ["rc", ] } serde_derive = "1.0" serde_json = { version = "1.0", features = ["raw_value",] } diff --git a/melib/src/email.rs b/melib/src/email.rs index b78575f2..b7057754 100644 --- a/melib/src/email.rs +++ b/melib/src/email.rs @@ -145,7 +145,7 @@ pub(crate) fn common_attributes() -> MacroOrMessageDataItemNames<'static> { } bitflags! { - #[derive(Default, Serialize, Deserialize)] + #[derive(Default, Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)] pub struct Flag: u8 { const PASSED = 0b0000_0001; const REPLIED = 0b0000_0010; diff --git a/melib/src/gpgme/mod.rs b/melib/src/gpgme/mod.rs index e18d2fcf..eff9842f 100644 --- a/melib/src/gpgme/mod.rs +++ b/melib/src/gpgme/mod.rs @@ -85,6 +85,7 @@ pub enum GpgmeFlag { } bitflags! { + #[derive(Default, Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct LocateKey: u8 { /// Locate a key using DNS CERT, as specified in RFC-4398. const CERT = 0b1; diff --git a/melib/src/imap/protocol_parser.rs b/melib/src/imap/protocol_parser.rs index 2d1acc3b..113799e5 100644 --- a/melib/src/imap/protocol_parser.rs +++ b/melib/src/imap/protocol_parser.rs @@ -48,7 +48,7 @@ use crate::{ const UNTAGGED_PREFIX: &[u8] = b"* "; bitflags! { - #[derive(Default, Serialize, Deserialize)] + #[derive(Default, Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct RequiredResponses: u64 { const CAPABILITY = 0b0000_0000_0000_0001; const BYE = 0b0000_0000_0000_0010; @@ -66,13 +66,13 @@ bitflags! { const SEARCH = 0b0010_0000_0000_0000; const FETCH = 0b0100_0000_0000_0000; const NO_REQUIRED = 0b1000_0000_0000_0000; - const CAPABILITY_REQUIRED = Self::CAPABILITY.bits; - const LOGOUT_REQUIRED = Self::BYE.bits; - const SELECT_REQUIRED = Self::FLAGS.bits | Self::EXISTS.bits | Self::RECENT.bits | Self::UNSEEN.bits | Self::PERMANENTFLAGS.bits | Self::UIDNEXT.bits | Self::UIDVALIDITY.bits; - const EXAMINE_REQUIRED = Self::FLAGS.bits | Self::EXISTS.bits | Self::RECENT.bits | Self::UNSEEN.bits | Self::PERMANENTFLAGS.bits | Self::UIDNEXT.bits | Self::UIDVALIDITY.bits; - const LIST_REQUIRED = Self::LIST.bits; - const LSUB_REQUIRED = Self::LSUB.bits; - const FETCH_REQUIRED = Self::FETCH.bits; + const CAPABILITY_REQUIRED = Self::CAPABILITY.bits(); + const LOGOUT_REQUIRED = Self::BYE.bits(); + const SELECT_REQUIRED = Self::FLAGS.bits() | Self::EXISTS.bits() | Self::RECENT.bits() | Self::UNSEEN.bits() | Self::PERMANENTFLAGS.bits() | Self::UIDNEXT.bits() | Self::UIDVALIDITY.bits(); + const EXAMINE_REQUIRED = Self::FLAGS.bits() | Self::EXISTS.bits() | Self::RECENT.bits() | Self::UNSEEN.bits() | Self::PERMANENTFLAGS.bits() | Self::UIDNEXT.bits() | Self::UIDVALIDITY.bits(); + const LIST_REQUIRED = Self::LIST.bits(); + const LSUB_REQUIRED = Self::LSUB.bits(); + const FETCH_REQUIRED = Self::FETCH.bits(); } }