Skip to content

Commit

Permalink
chore: use imap_types::{To,Into}Static instead of bounded_static
Browse files Browse the repository at this point in the history
  • Loading branch information
duesee committed Jul 10, 2024
1 parent 8b37002 commit 0a193b1
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 39 deletions.
33 changes: 11 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 2 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@ expose_stream = []
stream = ["dep:bytes", "dep:rustls", "dep:tokio", "dep:tokio-rustls"]

[dependencies]
bounded-static = "0.5.0"
bytes = { version = "1.6.0", optional = true }
imap-codec = { version = "2.0.0-alpha.1", features = ["starttls", "quirk_crlf_relaxed", "bounded-static", "ext_condstore_qresync", "ext_login_referrals", "ext_mailbox_referrals", "ext_id", "ext_sort_thread", "ext_binary", "ext_metadata", "ext_uidplus"] }
imap-types = { version = "2.0.0-alpha.1", features = ["starttls", "ext_condstore_qresync", "ext_login_referrals", "ext_mailbox_referrals", "ext_id", "ext_sort_thread", "ext_binary", "ext_metadata", "ext_uidplus"] }
imap-codec = { version = "2.0.0-alpha.1", features = ["starttls", "quirk_crlf_relaxed", "ext_condstore_qresync", "ext_login_referrals", "ext_mailbox_referrals", "ext_id", "ext_sort_thread", "ext_binary", "ext_metadata", "ext_uidplus"], git = "https://github.com/duesee/imap-codec", rev = "6bd83aff18fc12bad2b45c9fc50506b0c26ae2f6" }
imap-types = { version = "2.0.0-alpha.1", features = ["starttls", "ext_condstore_qresync", "ext_login_referrals", "ext_mailbox_referrals", "ext_id", "ext_sort_thread", "ext_binary", "ext_metadata", "ext_uidplus"], git = "https://github.com/duesee/imap-codec", rev = "6bd83aff18fc12bad2b45c9fc50506b0c26ae2f6" }
rustls = { version = "0.23.11", optional = true }
thiserror = "1.0.61"
tokio = { version = "1.38.0", optional = true, features = ["io-util", "macros", "net"] }
Expand All @@ -41,6 +40,3 @@ members = [
"tag-generator",
]

[patch.crates-io]
imap-codec = { git = "https://github.com/duesee/imap-codec", rev = "6aa651f6c74a4feb6696e7fb3e4c31b55ba64036" }
imap-types = { git = "https://github.com/duesee/imap-codec", rev = "6aa651f6c74a4feb6696e7fb3e4c31b55ba64036" }
4 changes: 2 additions & 2 deletions integration-test/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ license = "MIT OR Apache-2.0"
[dependencies]
bstr = { version = "1.9.1", default-features = false }
bytes = "1.6.0"
imap-codec = "2.0.0-alpha.1"
imap-codec = { version = "2.0.0-alpha.1", git = "https://github.com/duesee/imap-codec", rev = "6bd83aff18fc12bad2b45c9fc50506b0c26ae2f6" }
imap-next = { path = ".." }
imap-types = "2.0.0-alpha.1"
imap-types = { version = "2.0.0-alpha.1", git = "https://github.com/duesee/imap-codec", rev = "6bd83aff18fc12bad2b45c9fc50506b0c26ae2f6" }
tokio = { version = "1.38.0", features = ["macros", "net", "rt", "time"] }
tracing = "0.1.40"
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
Expand Down
2 changes: 1 addition & 1 deletion integration-test/src/client_tester.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use imap_next::{
client::{self, Client, CommandHandle},
stream::{self, Stream},
};
use imap_types::{bounded_static::ToBoundedStatic, command::Command};
use imap_types::{command::Command, ToStatic};
use tokio::net::TcpStream;
use tracing::trace;

Expand Down
2 changes: 1 addition & 1 deletion integration-test/src/server_tester.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use imap_next::{
server::{self, ResponseHandle, Server},
stream::{self, Stream},
};
use imap_types::{bounded_static::ToBoundedStatic, response::Response};
use imap_types::{response::Response, ToStatic};
use tokio::net::TcpListener;
use tracing::trace;

Expand Down
4 changes: 2 additions & 2 deletions proxy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ license = "MIT OR Apache-2.0"
anyhow = "1.0.86"
argh = "0.1.12"
colored = "2.1.0"
imap-codec = { version = "2.0.0-alpha.1", features = ["bounded-static", "quirk_crlf_relaxed", "ext_id"] }
imap-codec = { version = "2.0.0-alpha.1", features = ["quirk_crlf_relaxed", "ext_id"], git = "https://github.com/duesee/imap-codec", rev = "6bd83aff18fc12bad2b45c9fc50506b0c26ae2f6" }
imap-next = { path = ".." }
imap-types = { version = "2.0.0-alpha.1", features = ["bounded-static", "ext_id"] }
imap-types = { version = "2.0.0-alpha.1", features = ["ext_id"], git = "https://github.com/duesee/imap-codec", rev = "6bd83aff18fc12bad2b45c9fc50506b0c26ae2f6" }
once_cell = "1.19.0"
rustls-native-certs = "0.7.1"
rustls-pemfile = "2.1.2"
Expand Down
2 changes: 1 addition & 1 deletion proxy/src/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ use imap_next::{
stream::{self, Stream},
};
use imap_types::{
bounded_static::ToBoundedStatic,
command::{Command, CommandBody},
extensions::idle::IdleDone,
response::{Code, Status},
ToStatic,
};
use once_cell::sync::Lazy;
use thiserror::Error;
Expand Down
4 changes: 2 additions & 2 deletions src/receive.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use bounded_static::IntoBoundedStatic;
use imap_codec::decode::Decoder;
use imap_types::{
core::{LiteralMode, Tag},
secret::Secret,
IntoStatic,
};

use crate::{
Expand Down Expand Up @@ -65,7 +65,7 @@ impl ReceiveState {
pub fn next<C>(&mut self, codec: &C) -> Result<ReceiveEvent<C>, Interrupt<ReceiveError>>
where
C: Decoder,
for<'a> C::Message<'a>: IntoBoundedStatic<Static = C::Message<'static>>,
for<'a> C::Message<'a>: IntoStatic<Static = C::Message<'static>>,
{
loop {
// Parse the next fragment
Expand Down
2 changes: 1 addition & 1 deletion src/server.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::fmt::{Debug, Formatter};

use bounded_static::ToBoundedStatic;
use imap_codec::{
AuthenticateDataCodec, CommandCodec, GreetingCodec, IdleDoneCodec, ResponseCodec,
};
Expand All @@ -14,6 +13,7 @@ use imap_types::{
Status,
},
secret::Secret,
ToStatic,
};
use thiserror::Error;

Expand Down
2 changes: 1 addition & 1 deletion tag-generator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ edition = "2021"
license = "MIT OR Apache-2.0"

[dependencies]
imap-types = { version = "2.0.0-alpha.1", features = ["unvalidated"] }
imap-types = { version = "2.0.0-alpha.1", features = ["unvalidated"], git = "https://github.com/duesee/imap-codec", rev = "6bd83aff18fc12bad2b45c9fc50506b0c26ae2f6" }
rand = "0.8.5"

0 comments on commit 0a193b1

Please sign in to comment.