package_buildpack()
and package_crate_buildpack()
contain asserts!
even though they return Result
s
#709
Labels
package_buildpack()
and package_crate_buildpack()
contain asserts!
even though they return Result
s
#709
Currently these functions mix and match assertions and returning
Result
:libcnb.rs/libcnb-test/src/build.rs
Lines 15 to 27 in 2698a71
libcnb.rs/libcnb-test/src/build.rs
Lines 74 to 78 in 2698a71
These were introduced as part of #666, and are part of the reason that the regression in #704 was able to sneak in (since it means the tests circumvent the top level error handling that was broken in #666).
They should be converted to additional error types and returned as an error instead.
There's also a lint we can use to prevent this in the future:
https://rust-lang.github.io/rust-clippy/master/index.html#/panic_in_result_fn
(in addition to panics, it detects assertions in result functions)
The text was updated successfully, but these errors were encountered: