Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove erroneous reference to the base Symbol when mapping Rust types #1439

Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,15 @@ fun Symbol.makeOptional(): Symbol {
}
}

/** Map the RustType of a symbol with [f] */
/**
* Map the [RustType] of a symbol with [f].
*
* WARNING: This function does not set any `SymbolReference`s on the returned symbol. You will have to add those
* yourself if your logic relies on them.
**/
fun Symbol.mapRustType(f: (RustType) -> RustType): Symbol {
val newType = f(this.rustType())
return Symbol.builder().rustType(newType)
.addReference(this)
.name(newType.name)
.build()
}
Expand Down