Skip to main content

normalize_r_arg_string

Function normalize_r_arg_string 

Source
pub fn normalize_r_arg_string(name: &str) -> String
Expand description

Normalizes a Rust argument name (its crate::naming::ident_name, no r#) for R.

  • Leading _ → stripped (Rust convention for unused params)
  • Leading __ → stripped
  • Otherwise → unchanged

§Examples

  • _x → x
  • _to → to
  • __field → field
  • value → value

Note: We strip underscores rather than prefixing “unused” because R callers (like vctrs) may use named arguments that must match the original name.

This is the R formal of a parameter without a declared formal = ".." only: R-facing names come from Formals::of, which applies it.