Skip to content

Commit 7b3f5f1

Browse files
committed
rust: fix remaning clippy issues and add clippy to CI
1 parent 2c08ada commit 7b3f5f1

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

.ci/ci

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ make prepare-tidy
2323
make -j8 unit-test
2424
make -j8 run-unit-tests
2525
make -j8 run-rust-unit-tests
26+
27+
# Rust linter
28+
make -j8 run-rust-clippy
29+
2630
# Check that coverage report building is working.
2731
make coverage
2832

src/rust/bitbox02-rust-c/src/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ impl CStrMut {
189189
/// then are available.
190190
pub fn write<F>(&mut self, req: usize, f: F)
191191
where
192-
F: FnOnce(&mut [u8]) -> (),
192+
F: FnOnce(&mut [u8]),
193193
{
194194
// Must be room for requested amount of bytes and null terminator.
195195
if self.cap - self.len < req + 1 {

src/rust/bitbox02-rust-c/src/workflow.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ pub unsafe extern "C" fn rust_workflow_confirm_blocking(
155155
) -> bool {
156156
let title = crate::util::rust_util_cstr(params.title);
157157
let body = crate::util::rust_util_cstr(params.body);
158-
if params.font != core::ptr::null() {
158+
if !params.font.is_null() {
159159
panic!("Only default font supported");
160160
}
161161
let params = confirm::Params {

src/rust/bitbox02-rust/src/workflow/unlock.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ pub async fn unlock_keystore(title: &str) -> bool {
6666
Ok(()) => true,
6767
Err(keystore::Error::IncorrectPassword { remaining_attempts }) => {
6868
let msg = match remaining_attempts {
69-
1 => format!("Wrong password\n1 try remains"),
69+
1 => "Wrong password\n1 try remains".into(),
7070
n => format!("Wrong password\n{} tries remain", n),
7171
};
7272
status(&msg, false).await;

0 commit comments

Comments
 (0)