How to suppress “function is never used” warning for a function used by tests?
问题 I'm writing a program in Rust and I have some tests for it. I wrote a helper function for these tests, but whenever I build using cargo build it warns me that the function is never used: warning: function is never used: ... #[warn(dead_code)] on by default How I can mark this function as used so as not to get the warnings? 回答1: Specific question How I can mark this function as used so as not to get the warnings? The Rust compiler runs many lints to warn you about possible issues in your code