-
-
Notifications
You must be signed in to change notification settings - Fork 28
Better code style in build.rs #56
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
Conversation
Note that the build is currently broken because of |
My guess we should change |
This is not the right way to do it, we set |
But it looks bluetooth crates ecosystem moved on to Rust 2024. Shouldn't we set |
I don't think we should (it could break someone's build) if there's better solutions: #57 |
Looks good! Let's merge #57 so I could rebase my PR on top. |
Done |
build.rs
Outdated
.map(|x| x.path().to_owned()) | ||
.filter(|x| x.extension() == Some(std::ffi::OsStr::new("proto"))) |
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.
.map(|x| x.path().to_owned()) | |
.filter(|x| x.extension() == Some(std::ffi::OsStr::new("proto"))) | |
.map(|x| x.into_path()) | |
.filter(|x| x.extension().is_some_and(|ext| ext == "proto")) |
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.
Awesome, done
build.rs
Outdated
let protobufs_dir = "src/protobufs/"; | ||
let gen_dir = "src/generated/"; | ||
let src_dir = "src/protobufs/"; | ||
let out_dir = "src/generated/"; |
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.
out_dir
is not a good name, it already has a meaning inside of build.rs
:
https://doc.rust-lang.org/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-crates
I'd keep the original gen_dir
.
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.
makes sense, done
build.rs
for
)cargo clippy --features ts-gen
on Rust 1.88