MCPcopy Create free account
hub / github.com/dprint/jsonc-parser / as_str

Method as_str

src/ast.rs:388–393  ·  view source on GitHub ↗

Gets the object property name as a string reference.

(&'a self)

Source from the content-addressed store, hash-verified

386
387 /// Gets the object property name as a string reference.
388 pub fn as_str(&'a self) -> &'a str {
389 match self {
390 ObjectPropName::String(lit) => lit.value.as_ref(),
391 ObjectPropName::Word(lit) => lit.value,
392 }
393 }
394}
395
396/// Represents an array that may contain elements (ex. `[]`, `[5, 6]`).

Callers 3

getMethod · 0.45
takeMethod · 0.45
scan_from_toMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected