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

using format! instead #2

Open
ConnyOnny opened this issue Dec 28, 2016 · 1 comment
Open

using format! instead #2

ConnyOnny opened this issue Dec 28, 2016 · 1 comment

Comments

@ConnyOnny
Copy link

The Readme says

Rust's builtin format! can achieve the same functionality: https://doc.rust-lang.org/std/fmt/index.html#fillalignment

Can it though? I get this far:

format!("{:>width$}", string, width=codepoints)

But this does not work:

format!("{:pc$>width$}", string, width=codepoints, pc=pad_char)

It only works for fixed pad chars like so

format!("{:X>width$}", string, width=codepoints)

Where X has to be replaced by the actual pad char.

Do you know how to fix this?

@futile
Copy link
Owner

futile commented Dec 28, 2016

Do you know how to fix this?

Do you mean whether I know how to do that with format!? If you do, nope, I don't. It might actually not be doable with pure format, probably a good question for #rustc on irc/a users.rust-lang.org thread.

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

No branches or pull requests

2 participants