MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / unquote

Function unquote

atomic-audit/src/extract/languages.rs:458–474  ·  view source on GitHub ↗
(value: &str)

Source from the content-addressed store, hash-verified

456}
457
458fn unquote(value: &str) -> Option<String> {
459 let value = value.trim();
460 let stripped = if (value.starts_with('\"') && value.ends_with('\"'))
461 || (value.starts_with('\'') && value.ends_with('\''))
462 || (value.starts_with('`') && value.ends_with('`'))
463 || (value.starts_with('<') && value.ends_with('>'))
464 {
465 &value[1..value.len().checked_sub(1)?]
466 } else {
467 value
468 };
469 if stripped.is_empty() || stripped.contains(['\\', '$', '\n']) {
470 None
471 } else {
472 Some(stripped.into())
473 }
474}
475
476/// Distinct explicit dependency units, not a type-resolved coupling metric.
477fn rust_roots(node: Node<'_>, source: &str, result: &mut BTreeSet<String>) {

Callers 3

dependenciesFunction · 0.85
public_surfaceFunction · 0.85
captureFunction · 0.85

Calls 3

lenMethod · 0.45
is_emptyMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected