mirror of https://github.com/zkat/miette.git
feat(spans): make SourceSpan implement Copy (#151)
SourceSpan is just a pair of usizes, so it's cheap to copy.
This commit is contained in:
parent
97197601ee
commit
5e54b29acf
|
|
@ -47,7 +47,7 @@ impl SourceCode for NamedSource {
|
||||||
Ok(Box::new(MietteSpanContents::new_named(
|
Ok(Box::new(MietteSpanContents::new_named(
|
||||||
self.name.clone(),
|
self.name.clone(),
|
||||||
contents.data(),
|
contents.data(),
|
||||||
contents.span().clone(),
|
*contents.span(),
|
||||||
contents.line(),
|
contents.line(),
|
||||||
contents.column(),
|
contents.column(),
|
||||||
contents.line_count(),
|
contents.line_count(),
|
||||||
|
|
|
||||||
|
|
@ -345,7 +345,7 @@ impl<'a> SpanContents<'a> for MietteSpanContents<'a> {
|
||||||
/**
|
/**
|
||||||
Span within a [`SourceCode`] with an associated message.
|
Span within a [`SourceCode`] with an associated message.
|
||||||
*/
|
*/
|
||||||
#[derive(Clone, Debug, Eq, PartialEq, Hash)]
|
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
|
||||||
pub struct SourceSpan {
|
pub struct SourceSpan {
|
||||||
/// The start of the span.
|
/// The start of the span.
|
||||||
offset: SourceOffset,
|
offset: SourceOffset,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue