Skip to content

Commit 652eae5

Browse files
committed
Enable lints for unused code/dependencies in our Rust crates
Also forbid the use of `println!`, `eprintln!`, `dbg!` and similar invocations, which should not be allowed in a library.
1 parent 2d5884a commit 652eae5

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

ironfish-rust-nodejs/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
44

5+
#![warn(clippy::dbg_macro)]
6+
#![warn(clippy::print_stderr)]
7+
#![warn(clippy::print_stdout)]
58
#![warn(unreachable_pub)]
9+
#![warn(unused_crate_dependencies)]
10+
#![warn(unused_macro_rules)]
611
#![warn(unused_qualifications)]
712

813
use std::fmt::Display;

ironfish-rust/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
44

5+
#![warn(clippy::dbg_macro)]
6+
#![warn(clippy::print_stderr)]
7+
#![warn(clippy::print_stdout)]
58
#![warn(unreachable_pub)]
9+
#![warn(unused_crate_dependencies)]
10+
#![warn(unused_macro_rules)]
611
#![warn(unused_qualifications)]
712

813
#[cfg(feature = "transaction-proofs")]

ironfish-rust/src/mining/thread.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,7 @@ fn process_commands(
192192
}
193193

194194
if remaining_search_space < default_batch_size {
195-
// miner has exhausted it's search space, stop mining
196-
println!("Search space exhausted, no longer mining this block.");
195+
// miner has exhausted its search space, stop mining
197196
break;
198197
}
199198
batch_start += batch_size + step_size as u64 - (batch_size % step_size as u64);

ironfish-zkp/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1+
#![warn(clippy::dbg_macro)]
2+
#![warn(clippy::print_stderr)]
3+
#![warn(clippy::print_stdout)]
14
#![warn(unreachable_pub)]
5+
#![warn(unused_crate_dependencies)]
6+
#![warn(unused_macro_rules)]
27
#![warn(unused_qualifications)]
38

49
mod circuits;

0 commit comments

Comments
 (0)