-
Notifications
You must be signed in to change notification settings - Fork 43
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
rustfmt-formattable syntax? #35
Comments
I chose to use |
We don't really have the ability to format anything that's contained with any macro call using brace delimiters, so a change to
Our ability to format the out-of-line mods is heavily predicated on the current syntax, so the only immediate impact of from |
I just realized that this is possible while also solving #43. I implemented the macros in the use cfg_elif::item;
item::cfg!(if (feature == "foo") {
type Foo = usize;
} else if (target_pointer_width != "64") {
type Foo = isize;
} else if ((target_family == "unix") && (feature == "bar")) {
type Foo = i32;
} else if ((feature == "baz") || (target_os == "freebsd")) {
type Foo = i64;
} else if (!(panic == "unwind")) {
type Foo = i128;
} else {
type Foo = f64;
}); Will you accept a PR for this when I make one? Or, do you think this is to hacky for a repository under |
It's likely development efforts are going to be focused on getting |
I didn't know that the work is going on. Thank you for the info! |
I'm aware how minimal and stable this crate is and has been for a long time, but something that's always put me off from using it (usually in favor of manual
#[cfg]
attributes) is how its syntax is completely unfamiliar to rustfmt, and therefore any expressions or items inside of acfg_if!
block can't get the advantages that rustfmt brings.Was there a reason that you didn't choose a more traditional/valid rust syntax for the macro? e.g.
I'm aware that rustfmt wasn't as popular/well-integrated in 2017, but I feel like a syntax like this would greatly improve the ergonomics of this crate.
(feel free to ignore, I was just surprised that there wasn't an issue about this already)
The text was updated successfully, but these errors were encountered: