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

Example Ruby buildpack uses unwrap() in non-test code #746

Closed
edmorley opened this issue Nov 17, 2023 · 1 comment · Fixed by #757
Closed

Example Ruby buildpack uses unwrap() in non-test code #746

edmorley opened this issue Nov 17, 2023 · 1 comment · Fixed by #757
Labels
bug Something isn't working examples

Comments

@edmorley
Copy link
Member

We should not be using .unwrap() outside of tests.

These were found by the unwrap_used lint (which is about to be enabled across the whole repo).

layer_path.to_str().unwrap(),
"--binstubs",
layer_path.join("bin").to_str().unwrap(),

.args(["config", "--local", "path", layer.path.to_str().unwrap()])

layer.path.join("bin").as_path().to_str().unwrap(),

@edmorley edmorley added bug Something isn't working examples labels Nov 17, 2023
edmorley added a commit that referenced this issue Nov 17, 2023
As of the Cargo included in Rust 1.74, lints can now be configured
in `Cargo.toml` across whole crates/workspaces:
https://blog.rust-lang.org/2023/11/16/Rust-1.74.0.html
https://doc.rust-lang.org/stable/cargo/reference/manifest.html#the-lints-section
https://doc.rust-lang.org/stable/cargo/reference/workspaces.html#the-lints-table

This reduces the boilerplate, and chance that we forget to enable
lints in some targets. The only thing we need to remember is to
add the `[lints] workspace = true` to any new crates in the future.

Making this switch exposed a few places where lints weren't enabled
and issues had been missed, eg:
#746

Since this feature requires Rust 1.74, the MSRV has also been bumped.
(Though we will have had to do so soon anyway to be able to start
using `Result::inspect_err`, which is due in Rust 1.76, xref:
#723 (comment))

GUS-W-14511805.
@edmorley
Copy link
Member Author

edmorley commented Jan 3, 2024

Wontfix since the Ruby example has been removed in #757.

@edmorley edmorley closed this as not planned Won't fix, can't repro, duplicate, stale Jan 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working examples
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant