Code style and docs.

This commit is contained in:
Stephen Chung
2021-03-17 13:30:47 +08:00
parent 699131be58
commit 6667a22c0c
12 changed files with 172 additions and 103 deletions

View File

@@ -1398,12 +1398,14 @@ impl Module {
scope.into_iter().for_each(|(_, value, mut aliases)| {
// Variables with an alias left in the scope become module variables
if aliases.len() > 1 {
aliases.into_iter().for_each(|alias| {
match aliases.len() {
0 => (),
1 => {
module.variables.insert(aliases.pop().unwrap(), value);
}
_ => aliases.into_iter().for_each(|alias| {
module.variables.insert(alias, value.clone());
});
} else if aliases.len() == 1 {
module.variables.insert(aliases.pop().unwrap(), value);
}),
}
});