simple errors for lang-dev
| -rw-r--r-- | Cargo.toml | 2 | ||||
| -rw-r--r-- | src/lib.rs | 9 |
2 files changed, 10 insertions, 1 deletions
@@ -1,6 +1,6 @@ [package] name = "lerr" -version = "0.1.4" +version = "0.1.5" edition = "2021" license = "MIT" readme = "README.md" @@ -35,6 +35,15 @@ impl<S: ToString> From<(Span, S)> for Label { } } +impl<S: ToString> From<(&Span, S)> for Label { + fn from((span, m): (&Span, S)) -> Self { + Self { + span: span.clone(), + message: m.to_string(), + } + } +} + /// A note at the end of the diagnostic #[derive(Debug)] pub struct Note { |