-
Notifications
You must be signed in to change notification settings - Fork 20
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
[Merged by Bors] - chore: replace removed typfify::TypeSpace::to_string()
with prettyplease
#73
Conversation
I see that CI has failed, but I'm not sure how to fix it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this!
Regarding the failed check: https://github.com/substrait-io/substrait-rs/blob/main/CONTRIBUTING.md#pull-requests
prost-build = { version = "0.11", default-features = false } | ||
prost-types = "0.11" | ||
prost-wkt-build = { version = "0.4", optional = true } | ||
protobuf-src = { version = "1", optional = true } | ||
schemars = "0.8" | ||
serde_yaml = "0.9" | ||
syn = "1.0.109" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We just need the parsing
feature of syn
, and it seems version 2 was just released:
syn = "1.0.109" | |
syn = { version = "2.0.2", default-features = false, features = ["parsing"] } |
I'll change syn to only use the parsing feature... but |
Actually, it turns out that |
Let me know if there's something you need me to do to get this merged |
To fix the failing check can you please update the PR title to follow Conventional Commits. Maybe something like:
@westonpace can you please help review this? |
typify::TypeSpace::to_string()
which is going awaytypfify::TypeSpace::to_string()
with prettyplease
bors try |
bors r+ |
…please` (#73) The use of `typify` assumed that `rustfmt` was installed... which turned out not to be a great assumption. We've modified `typify` to remove the dependency on `rustfmt-wrapper` and have removed the interface that used it `ToString::to_string()`. Instead we recommend that consumers use `prettyplease` for `build.rs` uses such as the one in this crate. See oxidecomputer/typify#221 Alternatively, the `build.rs` could just emit the tokens unformatted (to remove the build-time dependency on `prettyplease` and `syn`), but that seems annoying if and when you need to look at the generated code. FWIW `syn` is an existing dependency; `prettyplease` is the only new new crate I see in `Cargo.lock`. I can share the full diff between the old and new versions of the `substrait_text.rs`, but here's a sample: ```diff @@ -1593,22 +1831,27 @@ T: std::convert::TryInto<Option<super::SessionDependent>>, T::Error: std::fmt::Display, { - self.session_dependent = value.try_into().map_err(|e| { - format!( - "error converting supplied value for session_dependent: {}", - e - ) - }); self + .session_dependent = value + .try_into() + .map_err(|e| { + format!( + "error converting supplied value for session_dependent: {}", e + ) + }); + self } pub fn variadic<T>(mut self, value: T) -> Self where T: std::convert::TryInto<Option<super::VariadicBehavior>>, T::Error: std::fmt::Display, { - self.variadic = value + self + .variadic = value .try_into() - .map_err(|e| format!("error converting supplied value for variadic: {}", e)); + .map_err(|e| { + format!("error converting supplied value for variadic: {}", e) + }); self } pub fn window_type<T>(mut self, value: T) -> Self ```
Pull request successfully merged into main. Build succeeded: |
typfify::TypeSpace::to_string()
with prettyplease
typfify::TypeSpace::to_string()
with prettyplease
The use of
typify
assumed thatrustfmt
was installed... which turned out not to be a great assumption. We've modifiedtypify
to remove the dependency onrustfmt-wrapper
and have removed the interface that used itToString::to_string()
. Instead we recommend that consumers useprettyplease
forbuild.rs
uses such as the one in this crate. See oxidecomputer/typify#221Alternatively, the
build.rs
could just emit the tokens unformatted (to remove the build-time dependency onprettyplease
andsyn
), but that seems annoying if and when you need to look at the generated code.FWIW
syn
is an existing dependency;prettyplease
is the only new new crate I see inCargo.lock
.I can share the full diff between the old and new versions of the
substrait_text.rs
, but here's a sample: