File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
codegen-core/src/main/kotlin/software/amazon/smithy/rust/codegen/core/rustlang Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -454,9 +454,7 @@ class RustWriter private constructor(
454
454
fun forModule (module : String? ): RustWriter = if (module == null ) {
455
455
RustWriter (" lib.rs" , " crate" )
456
456
} else {
457
- var writer = RustWriter (" $module .rs" , " crate::$module " )
458
- RenderSerdeAttribute .importSerde(writer)
459
- writer
457
+ RustWriter (" $module .rs" , " crate::$module " )
460
458
}
461
459
462
460
fun factory (debugMode : Boolean ): Factory <RustWriter > = Factory { fileName: String , namespace: String ->
@@ -517,6 +515,7 @@ class RustWriter private constructor(
517
515
init {
518
516
expressionStart = ' #'
519
517
if (filename.endsWith(" .rs" )) {
518
+ RenderSerdeAttribute .importSerde(this )
520
519
require(namespace.startsWith(" crate" ) || filename.startsWith(" tests/" )) {
521
520
" We can only write into files in the crate (got $namespace )"
522
521
}
You can’t perform that action at this time.
0 commit comments