Skip to content

transpile: Emit integer literal suffixes where possible#1920

Open
Rua wants to merge 1 commit into
immunant:masterfrom
Rua:literal-suffix
Open

transpile: Emit integer literal suffixes where possible#1920
Rua wants to merge 1 commit into
immunant:masterfrom
Rua:literal-suffix

Conversation

@Rua

@Rua Rua commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

A minor style improvement to the produced code.

@Rua
Rua force-pushed the literal-suffix branch from 149d990 to e51a641 Compare July 23, 2026 09:56

let lit_str = if let Some(suffix) = suffix {
match base {
IntBase::Dec => format!("{val}_{suffix}"),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@randomPoison @fw-immunant @thedataking Do we have a preference here between with and without the underscore? I'm slightly against it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I find the underscores a little clearer, but it doesn't matter to me that much.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm slightly in favor of underscore, but seems like a pretty inconsequential detail.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An anti-underscore vote here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh no XD

Comment thread c2rust-transpile/src/translator/literals.rs Outdated
@Rua
Rua force-pushed the literal-suffix branch from e51a641 to 235d498 Compare July 24, 2026 14:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants