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

Function attached_non_utf8_value

atomic-cli/src/agent_error.rs:415–423  ·  view source on GitHub ↗
(value: &OsStr, prefix: &str)

Source from the content-addressed store, hash-verified

413
414#[cfg(unix)]
415fn attached_non_utf8_value(value: &OsStr, prefix: &str) -> Option<OsString> {
416 use std::os::unix::ffi::{OsStrExt as _, OsStringExt as _};
417
418 let bytes = value.as_bytes();
419 let prefix = prefix.as_bytes();
420 bytes
421 .strip_prefix(prefix)
422 .map(|suffix| OsString::from_vec(suffix.to_vec()))
423}
424
425#[cfg(windows)]
426fn attached_non_utf8_value(value: &OsStr, prefix: &str) -> Option<OsString> {

Callers 1

attached_valueFunction · 0.85

Calls 2

as_bytesMethod · 0.45
as_sliceMethod · 0.45

Tested by

no test coverage detected