Skip to content

Commit

Permalink
docs: Improve code examples
Browse files Browse the repository at this point in the history
  • Loading branch information
coalooball authored Dec 7, 2023
1 parent 9f7b8cf commit 739e5d2
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions imap-codec/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@
//! ### Example
//!
//! ```rust
//! # use imap_codec::{
//! # decode::Decoder,
//! # imap_types::{
//! # core::Text,
//! # response::{Code, Greeting, GreetingKind},
//! # },
//! # GreetingCodec,
//! # };
//! // Run 'cargo add imap-types' in your project's root directory.
//! use imap_codec::{decode::Decoder, GreetingCodec};
//! use imap_types::{
//! core::Text,
//! response::{Code, Greeting, GreetingKind},
//! };
//!
//! let (remaining, greeting) = GreetingCodec::default()
//! .decode(b"* OK [ALERT] Hello, World!\r\n<remaining>")
//! .unwrap();
Expand All @@ -55,14 +54,13 @@
//! ### Example
//!
//! ```rust
//! # use imap_codec::{
//! # encode::Encoder,
//! # imap_types::{
//! # core::Text,
//! # response::{Code, Greeting, GreetingKind},
//! # },
//! # GreetingCodec,
//! # };
//! // Run 'cargo add imap-types' in your project's root directory.
//! use imap_codec::{encode::Encoder, GreetingCodec};
//! use imap_types::{
//! core::Text,
//! response::{Code, Greeting, GreetingKind},
//! };
//!
//! let greeting = Greeting {
//! kind: GreetingKind::Ok,
//! code: Some(Code::Alert),
Expand Down

0 comments on commit 739e5d2

Please sign in to comment.