MCPcopy Create free account
hub / github.com/AI45Lab/Code / strip_dir_name

Function strip_dir_name

core/src/workspace/s3.rs:1032–1040  ·  view source on GitHub ↗
(common_prefix: &str, listing_prefix: &str)

Source from the content-addressed store, hash-verified

1030}
1031
1032fn strip_dir_name(common_prefix: &str, listing_prefix: &str) -> Option<String> {
1033 let remainder = common_prefix.strip_prefix(listing_prefix)?;
1034 let trimmed = remainder.trim_end_matches('/');
1035 if trimmed.is_empty() {
1036 None
1037 } else {
1038 Some(trimmed.to_string())
1039 }
1040}
1041
1042fn strip_file_name(key: &str, listing_prefix: &str) -> Option<String> {
1043 let remainder = key.strip_prefix(listing_prefix)?;

Callers 1

list_dirMethod · 0.85

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected