Skip to content

Commit 3cd5f44

Browse files
author
hyd-dev
committed
Don't panic if CLIPPY_ARGS is not Unicode
1 parent 2d53b6b commit 3cd5f44

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/driver.rs

+2-8
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use rustc_span::symbol::Symbol;
2020
use rustc_tools_util::VersionInfo;
2121

2222
use std::borrow::Cow;
23-
use std::env::{self, VarError};
23+
use std::env;
2424
use std::lazy::SyncLazy;
2525
use std::ops::Deref;
2626
use std::panic;
@@ -314,13 +314,7 @@ pub fn main() {
314314
};
315315

316316
let mut no_deps = false;
317-
let clippy_args_var = env::var("CLIPPY_ARGS").map_or_else(
318-
|e| match e {
319-
VarError::NotPresent => None,
320-
VarError::NotUnicode(s) => panic!("CLIPPY_ARGS is not valid Unicode: {:?}", s),
321-
},
322-
Some,
323-
);
317+
let clippy_args_var = env::var("CLIPPY_ARGS").ok();
324318
let clippy_args = clippy_args_var
325319
.as_deref()
326320
.unwrap_or_default()

0 commit comments

Comments
 (0)