feat(source): derive common traits for NamedSource

This commit is contained in:
Brooks J Rady 2024-02-08 11:22:26 -08:00
parent c2f06f6cca
commit ad42459baf
1 changed files with 1 additions and 0 deletions

View File

@ -3,6 +3,7 @@ use crate::{MietteError, MietteSpanContents, SourceCode, SpanContents};
/// Utility struct for when you have a regular [`SourceCode`] type that doesn't
/// implement `name`. For example [`String`]. Or if you want to override the
/// `name` returned by the `SourceCode`.
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct NamedSource<S: SourceCode + 'static> {
source: S,
name: String,