Skip to content

Commit 5054e7d

Browse files
committed
remove Lazy for Mutex protected variables according to Mara Bos
1 parent b74df45 commit 5054e7d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,10 @@ requested on the command line with `-W clippy::unwrap-used`*/;
281281
Note that we don't keep the header because the line numbers are no longer important if we already know where the
282282
warning is and the inserted markup hints already shifted the original line numbers.
283283

284+
## Counting warnings
285+
286+
An alternative to count warnings (probably quicker) is to use "cargo lintcheck".
287+
284288
## Acknowledgement
285289

286290
- [David Wood](https://davidtw.co) offered the idea that we can use the `--message-format=json` option to get diagnostic information from the Rust compiler, which saves tremendous effort in modifying the Rust compiler. Now our solution is kind of independent from the Rust compiler implementations;

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ struct Args {
4949
mixed: bool,
5050
}
5151

52-
static ARGS: Lazy<Mutex<Vec<Args>>> = Lazy::new(|| Mutex::new(vec![]));
52+
static ARGS: Mutex<Vec<Args>> = Mutex::new(vec![]);
5353

5454
fn get_args() -> Vec<Args> {
5555
set_args();

0 commit comments

Comments
 (0)