Skip to content

Commit

Permalink
Rust: fix ill-conceived insertion of use declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
generalmimon committed Aug 31, 2024
1 parent 2332878 commit 24f04d9
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,11 @@ class RustCompiler(typeProvider: ClassTypeProvider, config: RuntimeConfig)
importList.add("use std::convert::{TryFrom, TryInto};")
importList.add("use std::cell::{Ref, Cell, RefCell};")
importList.add("use std::rc::{Rc, Weak};")

typeProvider.allClasses.foreach{
case (name, _) =>
if(name != topClassName) //TODO: do not add to imported
importList.add(s"use super::$name::*;")
}
}

override def externalTypeDeclaration(extType: ExternalType): Unit =
importList.add(
s"use super::${extType.name.head}::${type2class(extType.name.head)};"
s"use super::${extType.name.head}::${types2class(extType.name)};"
)

override def classHeader(name: List[String]): Unit = {
Expand Down

0 comments on commit 24f04d9

Please sign in to comment.