diff options
Diffstat (limited to 'crates/mozart-registry')
| -rw-r--r-- | crates/mozart-registry/src/downloader.rs | 8 | ||||
| -rw-r--r-- | crates/mozart-registry/src/lockfile.rs | 4 |
2 files changed, 4 insertions, 8 deletions
diff --git a/crates/mozart-registry/src/downloader.rs b/crates/mozart-registry/src/downloader.rs index 5431360..8c1f0b0 100644 --- a/crates/mozart-registry/src/downloader.rs +++ b/crates/mozart-registry/src/downloader.rs @@ -170,12 +170,8 @@ fn find_top_level_dir(entries: &[String]) -> Option<String> { let mut prefixes: HashSet<String> = HashSet::new(); for entry in entries { - if let Some(slash_pos) = entry.find('/') { - prefixes.insert(entry[..slash_pos + 1].to_string()); - } else { - // Entry at root level — no common prefix to strip - return None; - } + let slash_pos = entry.find('/')?; + prefixes.insert(entry[..slash_pos + 1].to_string()); } if prefixes.len() == 1 { diff --git a/crates/mozart-registry/src/lockfile.rs b/crates/mozart-registry/src/lockfile.rs index 64333e6..a9ecf36 100644 --- a/crates/mozart-registry/src/lockfile.rs +++ b/crates/mozart-registry/src/lockfile.rs @@ -661,7 +661,7 @@ mod tests { Some(vec!["MIT".to_string()].as_slice()) ); assert_eq!( - locked.keywords.as_ref().map(|k| k.as_slice()), + locked.keywords.as_deref(), Some(["example".to_string(), "test".to_string()].as_slice()) ); assert_eq!(locked.package_type.as_deref(), Some("library")); @@ -954,7 +954,7 @@ mod tests { // Verify that packages are sorted alphabetically when assembled in generate_lock_file // We test this by constructing two LockedPackages and sorting them the same way - let mut packages = vec