Skip to content

Commit decd579

Browse files
committed
minor touchups
1 parent ab56721 commit decd579

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

rust/saturn/src/resolution.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,12 +1055,9 @@ fn search_top_level(graph: &Graph, str_id: StringId) -> Outcome {
10551055
}
10561056

10571057
fn members_of(decl: &Declaration) -> &IdentityHashMap<StringId, DeclarationId> {
1058-
match decl {
1059-
Declaration::Class(it) => it.members(),
1060-
Declaration::SingletonClass(it) => it.members(),
1061-
Declaration::Module(it) => it.members(),
1062-
_ => panic!("Tried to get members for a declaration that isn't a namespace"),
1063-
}
1058+
decl.as_namespace()
1059+
.expect("Tried to get members for a declaration that isn't a namespace")
1060+
.members()
10641061
}
10651062

10661063
/// Returns a complexity score for a given name, which is used to sort names for resolution. The complexity is based

0 commit comments

Comments
 (0)