pub(crate) fn resolve_string<'a>(
        &self,
        storage: &Storage,
        source: &'a Source,
        with_template: ast::utils::WithTemplate,
    ) -> Result<Cow<'a, str>, ResolveError> {
        let span = self.token.span();

        let text = match self.source {
            ast::StrSource::Text(text) => text,
            ast::StrSource::Synthetic(id) => {
                let bytes = storage.get_string(id).ok_or_else(|| {
                    ResolveError::new(
                        span,
                        ResolveErrorKind::BadSyntheticId { kind: "string", id },
                    )
                })?;

                return Ok(Cow::Owned(bytes));
            }
        };

        let span = if text.wrapped { span.narrow(1) } else { span };

        let string = source
            .source(span)
            .ok_or_else(|| ResolveError::new(span, ResolveErrorKind::BadSlice))?;

        Ok(if text.escaped {
            Cow::Owned(Self::parse_escaped(span, string, with_template)?)
        } else {
            Cow::Borrowed(string)
        })
    }
/// Resolve the given string with the specified configuration.
Resolve the given string with the specified configuration.
Resolve the given string with the specified configuration .
pub(crate) fn resolve_string<'a>(
        &self,
        storage: &Storage,
        source: &'a Source,
        with_template: ast::utils::WithTemplate,
    ) -> Result<Cow<'a, str>, ResolveError> {
        let span = self.token.span();
        let text = match self.source {
            ast::StrSource::Text(text) => text,
            ast::StrSource::Synthetic(id) => {
                let bytes = storage.get_string(id).ok_or_else(|| {
                    ResolveError::new(
                        span,
                        ResolveErrorKind::BadSyntheticId { kind: "string", id },
                    )
                })?;
                return Ok(Cow::Owned(bytes));
            }
        };
        let span = if text.wrapped { span.narrow(1) } else { span };
        let string = source
            .source(span)
            .ok_or_else(|| ResolveError::new(span, ResolveErrorKind::BadSlice))?;
        Ok(if text.escaped {
            Cow::Owned(Self::parse_escaped(span, string, with_template)?)
        } else {
            Cow::Borrowed(string)
        })
    }
pub ( crate ) fn resolve_string < ' a > ( & self , storage : & Storage , source : & ' a Source , with_template : ast :: utils :: WithTemplate , ) -> Result < Cow < ' a , str > , ResolveError > { let span = self . token . span ( ) ; let text = match self . source { ast :: StrSource :: Text ( text ) => text , ast :: StrSource :: Synthetic ( id ) => { let bytes = storage . get_string ( id ) . ok_or_else ( | | { ResolveError :: new ( span , ResolveErrorKind :: BadSyntheticId { kind : " " , id } , ) } ) ? ; return Ok ( Cow :: Owned ( bytes ) ) ; } } ; let span = if text . wrapped { span . narrow ( 1 ) } else { span } ; let string = source . source ( span ) . ok_or_else ( | | ResolveError :: new ( span , ResolveErrorKind :: BadSlice ) ) ? ; Ok ( if text . escaped { Cow :: Owned ( Self :: parse_escaped ( span , string , with_template ) ? ) } else { Cow :: Borrowed ( string ) } ) }
Resolve the given string with the specified configuration.
Resolve the given string with the specified configuration .
&self
storage
&Storage
source
&'a Source
with_template
ast::utils::WithTemplate
&self
storage
&Storage
source
&'a Source
with_template
ast::utils::WithTemplate