Skip to content

Commit c47d750

Browse files
committed
chore: Add Clone to Message
1 parent 789d9e2 commit c47d750

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/snippet.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub(crate) const NOTE_TXT: &str = "note";
1111
pub(crate) const WARNING_TXT: &str = "warning";
1212

1313
/// Top-level user message
14-
#[derive(Debug)]
14+
#[derive(Clone, Debug)]
1515
pub struct Message<'a> {
1616
pub(crate) id: Option<&'a str>, // for "correctness", could be sloppy and be on Title
1717
pub(crate) groups: Vec<Group<'a>>,
@@ -76,7 +76,7 @@ impl<'a> Message<'a> {
7676
}
7777

7878
/// An [`Element`] container
79-
#[derive(Debug)]
79+
#[derive(Clone, Debug)]
8080
pub struct Group<'a> {
8181
pub(crate) elements: Vec<Element<'a>>,
8282
}
@@ -108,7 +108,7 @@ impl<'a> Group<'a> {
108108
}
109109

110110
/// A section of content within a [`Group`]
111-
#[derive(Debug)]
111+
#[derive(Clone, Debug)]
112112
#[non_exhaustive]
113113
pub enum Element<'a> {
114114
Title(Title<'a>),
@@ -149,13 +149,13 @@ impl From<Padding> for Element<'_> {
149149
}
150150

151151
/// A whitespace [`Element`] in a [`Group`]
152-
#[derive(Debug)]
152+
#[derive(Clone, Debug)]
153153
pub struct Padding;
154154

155155
/// A text [`Element`] in a [`Group`]
156156
///
157157
/// See [`Level::title`] to create this.
158-
#[derive(Debug)]
158+
#[derive(Clone, Debug)]
159159
pub struct Title<'a> {
160160
pub(crate) level: Level<'a>,
161161
pub(crate) title: &'a str,
@@ -170,7 +170,7 @@ impl Title<'_> {
170170
}
171171

172172
/// A source view [`Element`] in a [`Group`]
173-
#[derive(Debug)]
173+
#[derive(Clone, Debug)]
174174
pub struct Snippet<'a, T> {
175175
pub(crate) origin: Option<&'a str>,
176176
pub(crate) line_start: usize,

0 commit comments

Comments
 (0)