Struct mit_commit::Comments [−][src]
pub struct Comments { /* fields omitted */ }
Expand description
A collection of comments from a CommitMessage
Implementations
Iterate over the Comment
in the Comments
Examples
use mit_commit::{Comment, Comments};
let trailers = Comments::from(vec![
Comment::from("# Comment 1"),
Comment::from("# Comment 2"),
Comment::from("# Comment 3"),
]);
let mut iterator = trailers.iter();
assert_eq!(iterator.next(), Some(&Comment::from("# Comment 1")));
assert_eq!(iterator.next(), Some(&Comment::from("# Comment 2")));
assert_eq!(iterator.next(), Some(&Comment::from("# Comment 3")));
assert_eq!(iterator.next(), None);
Trait Implementations
Iterate over the Comment
in the Comments
Examples
use mit_commit::{Comment, Comments};
let trailers = Comments::from(vec![
Comment::from("# Comment 1"),
Comment::from("# Comment 2"),
Comment::from("# Comment 3"),
]);
let mut iterator = trailers.into_iter();
assert_eq!(iterator.next(), Some(Comment::from("# Comment 1")));
assert_eq!(iterator.next(), Some(Comment::from("# Comment 2")));
assert_eq!(iterator.next(), Some(Comment::from("# Comment 3")));
assert_eq!(iterator.next(), None);
Auto Trait Implementations
impl RefUnwindSafe for Comments
impl UnwindSafe for Comments
Blanket Implementations
Mutably borrows from an owned value. Read more