瀏覽代碼

Use is_err rather than pattern matching.

Paul Lietar 9 年之前
父節點
當前提交
f8cd09e5be
共有 1 個文件被更改,包括 2 次插入4 次删除
  1. 2 4
      src/main.rs

+ 2 - 4
src/main.rs

@@ -34,11 +34,9 @@ static APPKEY: Option<&'static [u8]> = Some(include_bytes!(concat!(env!("CARGO_M
 static APPKEY: Option<&'static [u8]> = None;
 
 fn main() {
-    let rust_log = "RUST_LOG";
-    if let Err(_) = env::var(rust_log) {
-        env::set_var(rust_log, "debug")
+    if env::var("RUST_LOG").is_err() {
+        env::set_var("RUST_LOG", "debug")
     }
-
     env_logger::init().unwrap();
 
     info!("librespot {} ({}). Built on {}.",