Make StrInput type publicly visible

For cases where you might need to, e.g, define a function with a `Parser<StrInput<'_>>` as argument
This commit is contained in:
Eduardo Sánchez Muñoz 2024-08-13 13:30:19 +02:00 committed by Ethiraric
parent 59048f68ae
commit 833343757a
2 changed files with 3 additions and 1 deletions

View file

@ -5,6 +5,7 @@ use crate::{
input::{Input, SkipTabs}, input::{Input, SkipTabs},
}; };
/// A parser input that uses a `&str` as source.
#[allow(clippy::module_name_repetitions)] #[allow(clippy::module_name_repetitions)]
pub struct StrInput<'a> { pub struct StrInput<'a> {
/// The input str buffer. /// The input str buffer.
@ -18,6 +19,7 @@ pub struct StrInput<'a> {
impl<'a> StrInput<'a> { impl<'a> StrInput<'a> {
/// Create a new [`StrInput`] with the given str. /// Create a new [`StrInput`] with the given str.
#[must_use]
pub fn new(input: &'a str) -> Self { pub fn new(input: &'a str) -> Self {
Self { Self {
buffer: input, buffer: input,

View file

@ -39,6 +39,6 @@ mod input;
mod parser; mod parser;
mod scanner; mod scanner;
pub use crate::input::{BufferedInput, Input}; pub use crate::input::{str::StrInput, BufferedInput, Input};
pub use crate::parser::{Event, EventReceiver, Parser, SpannedEventReceiver, Tag}; pub use crate::parser::{Event, EventReceiver, Parser, SpannedEventReceiver, Tag};
pub use crate::scanner::{Marker, ScanError, Span, TScalarStyle}; pub use crate::scanner::{Marker, ScanError, Span, TScalarStyle};