Skip to content

Commit

Permalink
Expose Source text
Browse files Browse the repository at this point in the history
  • Loading branch information
calder authored and zesterer committed Feb 5, 2024
1 parent bc46d05 commit e3ff5e2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ pub struct Source<I: AsRef<str> = String> {
len: usize,
}

impl<I: AsRef<str>> Source<I> {
/// Get the full text of this source file.
pub fn text(&self) -> &str {
self.text.as_ref()
}
}

impl<I: AsRef<str>> From<I> for Source<I> {
/// Generate a [`Source`] from the given [`str`].
///
Expand Down

0 comments on commit e3ff5e2

Please sign in to comment.