Skip to content

Commit 814f3aa

Browse files
committed
fixes compiler directive position
1 parent 7ed1767 commit 814f3aa

5 files changed

Lines changed: 12 additions & 12 deletions

File tree

frb_codegen/src/library/codegen/polisher/add_mod_to_lib.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ fn process_lib_rs_content(initial_content: &str, mod_name: &str) -> String {
9292
// Keep config lines (e.g. `#![allow(clippy::new_without_default)]`) on top of the file
9393
trimmed_line if trimmed_line.starts_with("#!") => {
9494
pre_code_injection_text.push_str(trimmed_line);
95-
pre_code_injection_text.push_str("\n");
95+
pre_code_injection_text.push('\n');
9696
last_line_was_empty = false;
9797
}
9898
trimmed_line if trimmed_line == legacy_frb_injected_code => {
@@ -351,7 +351,7 @@ mod tests {
351351
// END of AUTO INJECTED code\n\
352352
pub mod api;\n"
353353
);
354-
let result_content = process_lib_rs_content(&initial_content, mod_name);
354+
let _ = process_lib_rs_content(&initial_content, mod_name);
355355
}
356356

357357
#[test]
@@ -491,8 +491,7 @@ mod tests {
491491
let initial_content = "
492492
#![allow(clippy::new_without_default)]
493493
pub mod app;
494-
mod frb_generated;
495-
\n"
494+
"
496495
.to_string();
497496
let result_content = process_lib_rs_content(&initial_content, mod_name);
498497
let expected_code = format!(
@@ -505,8 +504,7 @@ mod tests {
505504
pub use crate::frb_generated::StreamSink as __FrbStreamSinkForLogging;\n\
506505
// END of AUTO INJECTED code\n\
507506
\n\
508-
pub mod app;\n\
509-
mod frb_generated;\n"
507+
pub mod app;\n"
510508
);
511509
assert_eq!(result_content, expected_code);
512510
}

frb_example/gallery/rust/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@ pub use crate::frb_generated::StreamSink as __FrbStreamSinkForLogging;
66
// END of AUTO INJECTED code
77

88
pub mod api;
9-
mod frb_generated;
109
pub mod ignore_me; /* AUTO INJECTED BY flutter_rust_bridge. This line may not be accurate, and you can change it according to your needs. */

frb_example/pure_dart_pde/rust/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
// AUTO-GENERATED FROM frb_example/pure_dart, DO NOT EDIT
2+
13
// AUTO INJECTED BY flutter_rust_bridge.
24
// The following lines may not be accurate; change them according to your needs.
35
mod frb_generated;
46
// this export is needed for logging
57
pub use crate::frb_generated::StreamSink as __FrbStreamSinkForLogging;
68
// END of AUTO INJECTED code
79

8-
// AUTO-GENERATED FROM frb_example/pure_dart, DO NOT EDIT
910
pub mod api;
1011
mod auxiliary;
1112
mod deliberate_name_conflict;

frb_example/rust_ui_counter/src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
2+
#![allow(clippy::new_without_default)]
3+
14
// AUTO INJECTED BY flutter_rust_bridge.
25
// The following lines may not be accurate; change them according to your needs.
36
mod frb_generated;
47
// this export is needed for logging
58
pub use crate::frb_generated::StreamSink as __FrbStreamSinkForLogging;
69
// END of AUTO INJECTED code
710

8-
#![allow(clippy::new_without_default)]
911
pub mod app;
10-
mod frb_generated;

frb_example/rust_ui_todo_list/src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
2+
#![allow(clippy::new_without_default)]
3+
14
// AUTO INJECTED BY flutter_rust_bridge.
25
// The following lines may not be accurate; change them according to your needs.
36
mod frb_generated;
47
// this export is needed for logging
58
pub use crate::frb_generated::StreamSink as __FrbStreamSinkForLogging;
69
// END of AUTO INJECTED code
710

8-
#![allow(clippy::new_without_default)]
911
pub mod app;
10-
mod frb_generated;

0 commit comments

Comments
 (0)