Function
strip_dir_name
(common_prefix: &str, listing_prefix: &str)
Source from the content-addressed store, hash-verified
| 1030 | } |
| 1031 | |
| 1032 | fn 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 | |
| 1042 | fn strip_file_name(key: &str, listing_prefix: &str) -> Option<String> { |
| 1043 | let remainder = key.strip_prefix(listing_prefix)?; |
Tested by
no test coverage detected