Skip to content

Commit 57d8a68

Browse files
authored
Merge pull request #260 from aatxe/develop
Release v1.0.0
2 parents d928062 + 3b9ab62 commit 57d8a68

File tree

21 files changed

+574
-413
lines changed

21 files changed

+574
-413
lines changed

.github/workflows/ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: CI
2+
3+
on:
4+
pull_request: {}
5+
push:
6+
branches:
7+
- develop
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
rust: ["1.71", stable]
16+
steps:
17+
- uses: actions/checkout@v3
18+
- uses: dtolnay/rust-toolchain@master
19+
with:
20+
toolchain: ${{matrix.rust}}
21+
- run: cargo build --workspace --all-targets
22+
- run: cargo build --workspace --all-targets --no-default-features
23+
- run: cargo build --workspace --all-targets --features tls-native
24+
- run: cargo build --workspace --all-targets --features tls-rust
25+
# runs all tests for all targets, including examples and benchmarks. Only on
26+
# stable, since we don't care about tests running on MSRV.
27+
- run: cargo test --workspace --all-targets
28+
if: matrix.rust == 'stable'
29+
# runs all documentation tests separately, since those are not picked up by
30+
# `--all-targets`.
31+
- run: cargo test --workspace --doc
32+
if: matrix.rust == 'stable'
33+
34+
rustfmt:
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v3
38+
- uses: dtolnay/rust-toolchain@stable
39+
with:
40+
components: rustfmt
41+
- run: cargo fmt --all --check

Cargo.toml

Lines changed: 37 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
[package]
22
name = "irc"
3-
version = "0.15.0"
4-
description = "the irc crate – usable, async IRC for Rust "
3+
version = "1.0.0"
54
authors = ["Aaron Weiss <aweiss@hey.com>"]
5+
edition = "2018"
6+
rust-version = "1.71"
7+
description = "the irc crate – usable, async IRC for Rust"
8+
documentation = "https://docs.rs/irc/"
9+
readme = "README.md"
10+
repository = "https://github.com/aatxe/irc"
611
license = "MPL-2.0"
712
keywords = ["irc", "client", "thread-safe", "async", "tokio"]
813
categories = ["asynchronous", "network-programming"]
9-
documentation = "https://docs.rs/irc/"
10-
repository = "https://github.com/aatxe/irc"
11-
readme = "README.md"
12-
edition = "2018"
1314

1415

1516
[badges]
@@ -23,9 +24,9 @@ members = [ "./", "irc-proto/" ]
2324

2425

2526
[features]
26-
default = ["ctcp", "tls-native", "toml_config"]
27+
default = ["ctcp", "tls-native", "channel-lists", "toml_config"]
2728
ctcp = []
28-
nochanlists = []
29+
channel-lists = []
2930

3031
json_config = ["serde", "serde/derive", "serde_derive", "serde_json"]
3132
toml_config = ["serde", "serde/derive", "serde_derive", "toml"]
@@ -37,46 +38,47 @@ yaml = ["yaml_config"]
3738
proxy = ["tokio-socks"]
3839

3940
tls-native = ["native-tls", "tokio-native-tls"]
40-
tls-rust = ["tokio-rustls", "webpki-roots"]
41+
tls-rust = ["tokio-rustls", "webpki-roots", "rustls-pemfile"]
4142

4243

4344
[dependencies]
44-
chrono = "0.4.0"
45-
encoding = "0.2.0"
46-
futures-util = { version = "0.3.0", default-features = false, features = ["alloc", "sink"] }
47-
irc-proto = { version = "0.14.0", path = "irc-proto" }
48-
log = "0.4.0"
49-
parking_lot = "0.11.0"
50-
thiserror = "1.0.0"
51-
pin-project = "1.0.2"
52-
tokio = { version = "1.0.0", features = ["net", "time", "sync"] }
53-
tokio-stream = "0.1.0"
54-
tokio-util = { version = "0.6.0", features = ["codec"] }
45+
chrono = { version = "0.4.24", default-features = false, features = ["clock", "std"] }
46+
encoding = "0.2.33"
47+
futures-util = { version = "0.3.30", default-features = false, features = ["alloc", "sink"] }
48+
irc-proto = { version = "1.0.0", path = "irc-proto" }
49+
log = "0.4.21"
50+
parking_lot = "0.12.1"
51+
thiserror = "1.0.58"
52+
pin-project = "1.0.12"
53+
tokio = { version = "1.27.0", features = ["net", "time", "sync"] }
54+
tokio-stream = "0.1.12"
55+
tokio-util = { version = "0.7.7", features = ["codec"] }
5556

5657
# Feature - Config
57-
serde = { version = "1.0.0", optional = true }
58-
serde_derive = { version = "1.0.0", optional = true }
59-
serde_json = { version = "1.0.0", optional = true }
60-
serde_yaml = { version = "0.8.0", optional = true }
61-
toml = { version = "0.5.0", optional = true }
58+
serde = { version = "1.0.160", optional = true }
59+
serde_derive = { version = "1.0.160", optional = true }
60+
serde_json = { version = "1.0.95", optional = true }
61+
serde_yaml = { version = "0.9.21", optional = true }
62+
toml = { version = "0.7.3", optional = true }
6263

6364
# Feature - Proxy
6465
tokio-socks = { version = "0.5.1", optional = true }
6566

6667
# Feature - TLS
67-
native-tls = { version = "0.2.0", optional = true }
68-
tokio-rustls = { version = "0.22.0", optional = true }
69-
tokio-native-tls = { version = "0.3.0", optional = true }
70-
webpki-roots = { version = "0.20.0", optional = true }
68+
native-tls = { version = "0.2.11", optional = true }
69+
tokio-rustls = { version = "0.24.0", features = ["dangerous_configuration"], optional = true }
70+
rustls-pemfile = { version = "1.0.2", optional = true }
71+
tokio-native-tls = { version = "0.3.1", optional = true }
72+
webpki-roots = { version = "0.23.0", optional = true }
7173

7274

7375
[dev-dependencies]
74-
anyhow = "1.0.0"
75-
args = "2.0.0"
76-
env_logger = "0.7.0"
77-
futures = "0.3.0"
78-
getopts = "0.2.0"
79-
tokio = { version = "1.0.0", features = ["rt", "rt-multi-thread", "macros", "net", "time"] }
76+
anyhow = "1.0.81"
77+
args = "2.2.0"
78+
env_logger = "0.11.0"
79+
futures = "0.3.30"
80+
getopts = "0.2.21"
81+
tokio = { version = "1.27.0", features = ["rt", "rt-multi-thread", "macros", "net", "time"] }
8082

8183

8284
[[example]]

README.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# the irc crate [![Build Status][ci-badge]][ci] [![Crates.io][cr-badge]][cr] ![Downloads][dl-badge] [![Docs][doc-badge]][doc]
22

3-
[ci-badge]: https://travis-ci.org/aatxe/irc.svg?branch=stable
4-
[ci]: https://travis-ci.org/aatxe/irc
3+
[ci-badge]: https://github.com/aatxe/irc/actions/workflows/ci.yml/badge.svg
4+
[ci]: https://github.com/aatxe/irc/actions/workflows/ci.yml
55
[cr-badge]: https://img.shields.io/crates/v/irc.svg
66
[cr]: https://crates.io/crates/irc
77
[dl-badge]: https://img.shields.io/crates/d/irc.svg
88
[doc-badge]: https://docs.rs/irc/badge.svg
99
[doc]: https://docs.rs/irc
1010

11-
[rfc2812]: http://tools.ietf.org/html/rfc2812
11+
[rfc2812]: http://datatracker.ietf.org/doc/html/rfc2812
1212
[ircv3.1]: http://ircv3.net/irc/3.1.html
1313
[ircv3.2]: http://ircv3.net/irc/3.2.html
1414

@@ -41,7 +41,7 @@ Making your own project? [Submit a pull request](https://github.com/aatxe/irc/pu
4141

4242
## Getting Started
4343

44-
To start using the irc crate with cargo, you can add `irc = "0.13"` to your dependencies in
44+
To start using the irc crate with cargo, you can add `irc = "0.15"` to your dependencies in
4545
your Cargo.toml file. The high-level API can be found in [`irc::client::prelude`][irc-prelude].
4646
You'll find a number of examples to help you get started in `examples/`, throughout the
4747
documentation, and below.
@@ -62,7 +62,7 @@ async fn main() -> Result<(), failure::Error> {
6262
let config = Config {
6363
nickname: Some("the-irc-crate".to_owned()),
6464
server: Some("chat.freenode.net".to_owned()),
65-
channels: Some(vec!["#test".to_owned()]),
65+
channels: vec!["#test".to_owned()],
6666
..Config::default()
6767
};
6868
@@ -79,6 +79,22 @@ async fn main() -> Result<(), failure::Error> {
7979
}
8080
```
8181

82+
Example Cargo.toml file:
83+
```rust,no_run,edition2018
84+
[package]
85+
name = "example"
86+
version = "0.1.0"
87+
edition = "2018"
88+
89+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
90+
91+
[dependencies]
92+
irc = "0.15.0"
93+
tokio = { version = "1.0.0", features = ["rt", "rt-multi-thread", "macros", "net", "time"] }
94+
futures = "0.3.0"
95+
failure = "0.1.8"
96+
```
97+
8298
## Configuring IRC Clients
8399

84100
As seen above, there are two techniques for configuring the irc crate: runtime loading and
@@ -120,7 +136,7 @@ user_info = "I'm a test user for the irc crate."
120136
version = "irc:git:Rust"
121137
source = "https://github.com/aatxe/irc"
122138
ping_time = 180
123-
ping_timeout = 10
139+
ping_timeout = 20
124140
burst_window_length = 8
125141
max_messages_in_burst = 15
126142
should_ghost = false

examples/build-bot.rs

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,20 @@ async fn main() -> irc::error::Result<()> {
2727
let mut stream = client.stream()?;
2828

2929
while let Some(message) = stream.next().await.transpose()? {
30-
match message.command {
31-
Command::Response(Response::RPL_ISUPPORT, _) => {
32-
client.send_privmsg(
33-
"#commits",
34-
format!(
35-
"[{}/{}] ({}) {} [{}]",
36-
repository_slug,
37-
branch,
38-
&commit[..7],
39-
commit_message,
40-
features,
41-
),
42-
)?;
43-
44-
client.send_quit("QUIT")?;
45-
}
46-
_ => (),
30+
if let Command::Response(Response::RPL_ISUPPORT, _) = message.command {
31+
client.send_privmsg(
32+
"#commits",
33+
format!(
34+
"[{}/{}] ({}) {} [{}]",
35+
repository_slug,
36+
branch,
37+
&commit[..7],
38+
commit_message,
39+
features,
40+
),
41+
)?;
42+
43+
client.send_quit("QUIT")?;
4744
}
4845
}
4946

examples/multiserver.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,10 @@ async fn main() -> irc::error::Result<()> {
4545
fn process_msg(sender: &Sender, message: Message) -> error::Result<()> {
4646
print!("{}", message);
4747

48-
match message.command {
49-
Command::PRIVMSG(ref target, ref msg) => {
50-
if msg.contains("pickles") {
51-
sender.send_privmsg(target, "Hi!")?;
52-
}
48+
if let Command::PRIVMSG(ref target, ref msg) = message.command {
49+
if msg.contains("pickles") {
50+
sender.send_privmsg(target, "Hi!")?;
5351
}
54-
_ => (),
5552
}
5653

5754
Ok(())

examples/repeater.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ async fn main() -> irc::error::Result<()> {
2222
let message = stream.select_next_some().await?;
2323

2424
if let Command::PRIVMSG(ref target, ref msg) = message.command {
25-
if msg.starts_with(&*client.current_nickname()) {
25+
if msg.starts_with(client.current_nickname()) {
2626
let tokens: Vec<_> = msg.split(' ').collect();
2727
if tokens.len() > 2 {
2828
let n = tokens[0].len() + tokens[1].len() + 2;

examples/simple.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,10 @@ async fn main() -> irc::error::Result<()> {
1919
while let Some(message) = stream.next().await.transpose()? {
2020
print!("{}", message);
2121

22-
match message.command {
23-
Command::PRIVMSG(ref target, ref msg) => {
24-
if msg.contains(client.current_nickname()) {
25-
sender.send_privmsg(target, "Hi!")?;
26-
}
22+
if let Command::PRIVMSG(ref target, ref msg) = message.command {
23+
if msg.contains(client.current_nickname()) {
24+
sender.send_privmsg(target, "Hi!")?;
2725
}
28-
_ => (),
2926
}
3027
}
3128

examples/simple_plaintext.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,10 @@ async fn main() -> irc::error::Result<()> {
2020
while let Some(message) = stream.next().await.transpose()? {
2121
print!("{}", message);
2222

23-
match message.command {
24-
Command::PRIVMSG(ref target, ref msg) => {
25-
if msg.contains(client.current_nickname()) {
26-
sender.send_privmsg(target, "Hi!")?;
27-
}
23+
if let Command::PRIVMSG(ref target, ref msg) = message.command {
24+
if msg.contains(client.current_nickname()) {
25+
sender.send_privmsg(target, "Hi!")?;
2826
}
29-
_ => (),
3027
}
3128
}
3229

examples/simple_proxy.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,10 @@ async fn main() -> irc::error::Result<()> {
2222
while let Some(message) = stream.next().await.transpose()? {
2323
print!("{}", message);
2424

25-
match message.command {
26-
Command::PRIVMSG(ref target, ref msg) => {
27-
if msg.contains(client.current_nickname()) {
28-
sender.send_privmsg(target, "Hi!")?;
29-
}
25+
if let Command::PRIVMSG(ref target, ref msg) = message.command {
26+
if msg.contains(client.current_nickname()) {
27+
sender.send_privmsg(target, "Hi!")?;
3028
}
31-
_ => (),
3229
}
3330
}
3431

irc-proto/Cargo.toml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
[package]
22
name = "irc-proto"
3-
version = "0.14.0"
4-
description = "The IRC protocol distilled."
3+
version = "1.0.0"
54
authors = ["Aaron Weiss <aweiss@hey.com>"]
5+
edition = "2018"
6+
rust-version = "1.60"
7+
description = "The IRC protocol distilled."
8+
documentation = "https://docs.rs/irc-proto/"
9+
repository = "https://github.com/aatxe/irc"
610
license = "MPL-2.0"
711
keywords = ["irc", "protocol", "tokio"]
812
categories = ["network-programming"]
9-
documentation = "https://docs.rs/irc-proto/"
10-
repository = "https://github.com/aatxe/irc"
11-
edition = "2018"
1213

1314
[badges]
1415
travis-ci = { repository = "aatxe/irc" }
@@ -17,9 +18,9 @@ travis-ci = { repository = "aatxe/irc" }
1718
default = ["bytes", "tokio", "tokio-util"]
1819

1920
[dependencies]
20-
encoding = "0.2.0"
21-
thiserror = "1.0.0"
21+
encoding = "0.2.33"
22+
thiserror = "1.0.40"
2223

23-
bytes = { version = "1.0.0", optional = true }
24-
tokio = { version = "1.0.0", optional = true }
25-
tokio-util = { version = "0.6.0", features = ["codec"], optional = true }
24+
bytes = { version = "1.4.0", optional = true }
25+
tokio = { version = "1.27.0", optional = true }
26+
tokio-util = { version = "0.7.7", features = ["codec"], optional = true }

0 commit comments

Comments
 (0)