Skip to main content

swift_case_safe_name

Function swift_case_safe_name 

Source
pub fn swift_case_safe_name(name: &str) -> Option<String>
Expand description

Returns Some(backtick_escaped_name) if name is a Swift reserved keyword, else None.

Use this for identifiers that appear in emitted Swift source code — enum cases, struct field names, function parameter labels — where the idiomatic escape for a keyword collision is `keyword` (backticks) rather than a trailing underscore. For identifiers on the Rust side of the swift-bridge boundary use swift_safe_name / swift_ident instead.