/// Construct a new source with the given name.
Construct a new source with the given name.
Construct a new source with the given name .
pub fn new<N, S>(name: N, source: S) -> Self
    where
        N: AsRef<str>,
        S: AsRef<str>,
    {
        let source = source.as_ref();
        let line_starts = line_starts(source).collect::<Vec<_>>();
        Self {
            name: name.as_ref().to_owned(),
            source: source.to_owned(),
            path: None,
            line_starts,
        }
    }
pub fn new < N , S > ( name : N , source : S ) -> Self where N : AsRef < str > , S : AsRef < str > , { let source = source . as_ref ( ) ; let line_starts = line_starts ( source ) . collect :: < Vec < _ > > ( ) ; Self { name : name . as_ref ( ) . to_owned ( ) , source : source . to_owned ( ) , path : None , line_starts , } }
Construct a new source with the given name.
Construct a new source with the given name .
name
N
source
S