Skip to main content

scalar_charsxp

Function scalar_charsxp 

Source
pub(crate) fn scalar_charsxp(sexp: SEXP) -> Result<SEXP, SexpError>
Expand description

Shared scalar-STRSXP prologue: type-check + len == 1 + string_elt(0).

Returns the raw CHARSXP; NA (SEXP::na_string()) and blank-string (SEXP::blank_string()) policy stay the caller’s decision — some sites error on NA, some map it to "", some to None, and String’s blank handling has historically differed from &str’s (see audit D6 finding #3), so this helper does not paper over that divergence.