How to disable dead code warnings at the crate level in Rust?
Hi! I've just started learning Rust and encountered an annoying problem. I have a crate with many helper functions written for future features. For example, I'm implementing a library for working with matrices, and it has functions that are not used yet but will be needed in the next sprint:
```rust
// This is part of my matrix_ops library
pub fn transpose(matrix: &Vec>) -> Vec> {
// implementation...
}
pub fn determinant(matrix: &Vec>) -> i32 {
// implementation...
}
fn main() {
let m = vec![vec![1, 2], vec![3, 4]];
// currently only using transpose
let t = transpose(&m);
println!("{:?}", t);
}
```
When compiling, I get a bunch of warnings like:
```
warning: function `determinant` is never used
--> sr
```
No answers yet.
Log in to leave an answer
Blogs