Remove needless main() definition from example
This commit is contained in:
parent
dfcec577d8
commit
a65a273e8d
34
src/lib.rs
34
src/lib.rs
|
@ -35,26 +35,24 @@
|
||||||
//! You can parse IRC messages using the provided `parse` function.
|
//! You can parse IRC messages using the provided `parse` function.
|
||||||
//!
|
//!
|
||||||
//! ```
|
//! ```
|
||||||
//! fn main() {
|
//! let msg = "@id=123;name=rick :nick!user@host.tmi.twitch.tv PRIVMSG #rickastley :Never gonna give you up!";
|
||||||
//! let msg = "@id=123;name=rick :nick!user@host.tmi.twitch.tv PRIVMSG #rickastley :Never gonna give you up!";
|
//! match ircparser::parse(msg) {
|
||||||
//! match ircparser::parse(msg) {
|
//! Ok(x) => {
|
||||||
//! Ok(x) => {
|
//! let line = x;
|
||||||
//! let line = x;
|
|
||||||
//!
|
//!
|
||||||
//! assert_eq!(&line.tags["id"], "123");
|
//! assert_eq!(&line.tags["id"], "123");
|
||||||
//! if line.source.is_some() {
|
//! if line.source.is_some() {
|
||||||
//! assert_eq!(line.source.unwrap(), ":nick!user@host.tmi.twitch.tv");
|
//! assert_eq!(line.source.unwrap(), ":nick!user@host.tmi.twitch.tv");
|
||||||
//! }
|
|
||||||
//! assert_eq!(line.command, "PRIVMSG");
|
|
||||||
//! assert_eq!(line.params[0], "#rickastley");
|
|
||||||
//! assert_eq!(line.params[1], "Never gonna give you up!");
|
|
||||||
//! }
|
//! }
|
||||||
//! Err(e) => {
|
//! assert_eq!(line.command, "PRIVMSG");
|
||||||
//! println!("A parsing error occured: {e}");
|
//! assert_eq!(line.params[0], "#rickastley");
|
||||||
//! return;
|
//! assert_eq!(line.params[1], "Never gonna give you up!");
|
||||||
//! }
|
//! }
|
||||||
//! };
|
//! Err(e) => {
|
||||||
//! }
|
//! println!("A parsing error occured: {e}");
|
||||||
|
//! return;
|
||||||
|
//! }
|
||||||
|
//! };
|
||||||
//! ```
|
//! ```
|
||||||
|
|
||||||
mod line;
|
mod line;
|
||||||
|
|
Loading…
Reference in a new issue