Skip to content

Commit eef8ac5

Browse files
committed
add clippy lints for unwrap/assert*/panic/expect to hyperlight_common
Signed-off-by: Simon Davies <[email protected]>
1 parent 1716a9a commit eef8ac5

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
disallowed-macros = [
2+
{ path = "std::assert", reason = "no asserts in release builds" },
3+
{ path = "std::assert_eq", reason = "no asserts in release builds" },
4+
{ path = "std::assert_ne", reason = "no asserts in release builds" },
5+
{ path = "std::assert_true", reason = "no asserts in release builds" },
6+
{ path = "std::assert_false", reason = "no asserts in release builds" },
7+
]

src/hyperlight_common/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ See the License for the specific language governing permissions and
1414
limitations under the License.
1515
*/
1616

17+
#![cfg_attr(not(any(test, debug_assertions)), warn(clippy::panic))]
18+
#![cfg_attr(not(any(test, debug_assertions)), warn(clippy::expect_used))]
19+
#![cfg_attr(not(any(test, debug_assertions)), warn(clippy::unwrap_used))]
1720
// We use Arbitrary during fuzzing, which requires std
1821
#![cfg_attr(not(feature = "fuzzing"), no_std)]
1922

@@ -26,6 +29,7 @@ pub mod flatbuffer_wrappers;
2629
dead_code,
2730
unused_imports,
2831
clippy::all,
32+
clippy::unwrap_used,
2933
unsafe_op_in_unsafe_fn,
3034
non_camel_case_types
3135
)]

0 commit comments

Comments
 (0)