mirror of
https://github.com/akitaonrails/ai-memory.git
synced 2026-10-02 03:24:46 +08:00
fix: simplify normalize_segments
This commit is contained in:
@@ -777,10 +777,9 @@ fn normalize_segments(path: &str) -> Option<String> {
|
||||
format!("{}:/", path[..1].to_ascii_uppercase()),
|
||||
path[3..].split('/').collect(),
|
||||
)
|
||||
} else if let Some(rest) = path.strip_prefix('/') {
|
||||
("/".into(), rest.split('/').collect())
|
||||
} else {
|
||||
return None;
|
||||
let rest = path.strip_prefix('/')?;
|
||||
("/".into(), rest.split('/').collect())
|
||||
};
|
||||
let mut parts = Vec::new();
|
||||
for part in tail {
|
||||
|
||||
Reference in New Issue
Block a user