Skip to content

Commit a740b44

Browse files
minor: fmt
1 parent 3609fa3 commit a740b44

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

compiler-cli/src/publish.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,13 +382,18 @@ fn do_build_hex_tarball(paths: &ProjectPaths, config: &mut PackageConfig) -> Res
382382
});
383383
}
384384

385-
let empty_modules: Vec<_> = built.root_package.modules
385+
let empty_modules: Vec<_> = built
386+
.root_package
387+
.modules
386388
.iter()
387389
.filter(|module| {
388-
module.ast.definitions
390+
module
391+
.ast
392+
.definitions
389393
.iter()
390394
.filter(|def| def.is_public())
391-
.count() == 0
395+
.count()
396+
== 0
392397
})
393398
.map(|module| module.name.clone())
394399
.collect();

compiler-core/src/build/package_compiler.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -550,19 +550,22 @@ fn analyse(
550550
// Register the types from this module so they can be imported into
551551
// other modules.
552552
let _ = module_types.insert(module.name.clone(), module.ast.type_info.clone());
553-
553+
554554
// Check for empty modules and emit warning
555-
let public_definitions = module.ast.definitions.iter()
555+
let public_definitions = module
556+
.ast
557+
.definitions
558+
.iter()
556559
.filter(|def| def.is_public())
557560
.count();
558-
561+
559562
if public_definitions == 0 {
560563
warnings.emit(crate::warning::Warning::EmptyModule {
561564
path: module.input_path.clone(),
562565
name: module.name.clone(),
563566
});
564567
}
565-
568+
566569
// Register the successfully type checked module data so that it can be
567570
// used for code generation and in the language server.
568571
modules.push(module);

0 commit comments

Comments
 (0)