summaryrefslogtreecommitdiff
path: root/src/compile.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/compile.rs')
-rw-r--r--src/compile.rs10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/compile.rs b/src/compile.rs
index ccbf6f0..9e19b18 100644
--- a/src/compile.rs
+++ b/src/compile.rs
@@ -8,16 +8,12 @@ fn symbol_table_from_path<'a>(
) -> Option<&'a ScopedSymbolTable<'a>> {
let mut symbol_table = symbol_table;
for component in path.split("::") {
- if let Some(module) = symbol_table
+ let module = symbol_table
.modules
.values()
.find(|module| module.name == Some(component))
- .and_then(|module| module.symbol_table)
- {
- symbol_table = module;
- } else {
- return None;
- }
+ .and_then(|module| module.symbol_table)?;
+ symbol_table = module;
}
Some(symbol_table)