Skip to content

Commit 568d495

Browse files
bennysjogoffart
authored andcommitted
Get tid of a "unused_import" Rust warning when builind Slint code
This may only happen when slint-build/experimental-module-builds feature is enabled, and in a very specific circumstanances the type is collected as 'used', but not directly used by the generated Rust code. CC #7060
1 parent 17600ba commit 568d495

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

internal/compiler/generator/rust.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,10 @@ pub fn generate(
180180
.iter()
181181
.map(|(symbol, library_info)| {
182182
let ident = qualified_name_ident(symbol, library_info);
183-
quote!(pub use #ident;)
183+
quote!(
184+
#[allow(unused_imports)]
185+
pub use #ident;
186+
)
184187
})
185188
.chain(doc_used_types.library_global_imports.iter().map(|(symbol, library_info)| {
186189
let ident = qualified_name_ident(symbol, library_info);

0 commit comments

Comments
 (0)