diff --git a/src/config.rs b/src/config.rs index b37a27d..9efc0b9 100644 --- a/src/config.rs +++ b/src/config.rs @@ -150,8 +150,8 @@ packages = ["svm-rs-builds"] #[test] fn missing_config() { let config = Config::load_from(Path::new("/nonexistent/config.toml")); - assert!(config.directories.is_empty()); - assert!(config.packages.is_empty()); + assert_eq!([] as [PathBuf; 0], config.directories.as_slice()); + assert_eq!([] as [String; 0], config.packages.as_slice()); } #[test] @@ -161,8 +161,8 @@ packages = ["svm-rs-builds"] write(&path_buf, "").unwrap(); let config = Config::load_from(&path_buf); - assert!(config.directories.is_empty()); - assert!(config.packages.is_empty()); + assert_eq!([] as [PathBuf; 0], config.directories.as_slice()); + assert_eq!([] as [String; 0], config.packages.as_slice()); } #[test] @@ -179,7 +179,7 @@ packages = ["foo"] .unwrap(); let config = Config::load_from(&path_buf); - assert!(config.directories.is_empty()); + assert_eq!([] as [PathBuf; 0], config.directories.as_slice()); assert_eq!(config.packages, vec!["foo"]); } @@ -198,7 +198,7 @@ directories = ["/tmp/myproject"] let config = Config::load_from(&path_buf); assert_eq!(config.directories, vec![PathBuf::from("/tmp/myproject")]); - assert!(config.packages.is_empty()); + assert_eq!([] as [String; 0], config.packages.as_slice()); } #[test] @@ -215,7 +215,7 @@ packages = ["foo"] .unwrap(); let config = Config::load_from(&path_buf); - assert!(config.packages.is_empty()); + assert_eq!([] as [String; 0], config.packages.as_slice()); } #[test] diff --git a/src/util/common.rs b/src/util/common.rs index 3c96cdb..f4a425e 100644 --- a/src/util/common.rs +++ b/src/util/common.rs @@ -132,7 +132,7 @@ fn split_escaped(mut s: &str) -> Result> { let mut v = vec![String::new()]; while let Some(i) = s.find(|c: char| c.is_ascii_whitespace() || c == '\\') { - debug_assert!(!v.is_empty()); + debug_assert_ne!([] as [String; 0], v.as_slice()); // smoelius: Only the last string in `v` can be empty. debug_assert!( v.iter() diff --git a/tests/supply_chain.json b/tests/supply_chain.json index 9e1c481..6b23264 100644 --- a/tests/supply_chain.json +++ b/tests/supply_chain.json @@ -31,12 +31,6 @@ } ], "cfg-if": [ - { - "id": 11, - "kind": "team", - "login": "github:rust-lang:libs", - "name": "libs" - }, { "id": 55123, "kind": "user", @@ -201,42 +195,6 @@ } ], "libc": [ - { - "id": 3, - "kind": "user", - "login": "huonw", - "name": "Huon Wilson" - }, - { - "id": 11, - "kind": "team", - "login": "github:rust-lang:libs", - "name": "libs" - }, - { - "id": 3623, - "kind": "team", - "login": "github:rust-lang:libc", - "name": "libc" - }, - { - "id": 4333, - "kind": "user", - "login": "joshtriplett", - "name": "Josh Triplett" - }, - { - "id": 5725, - "kind": "user", - "login": "gnzlbg", - "name": "gnzlbg" - }, - { - "id": 51017, - "kind": "user", - "login": "JohnTitor", - "name": "Yuki Okushi" - }, { "id": 55123, "kind": "user", @@ -271,12 +229,6 @@ "login": "github:rust-lang-nursery:log-owners", "name": "log-owners" }, - { - "id": 51, - "kind": "team", - "login": "github:rust-lang-nursery:libs", - "name": "libs" - }, { "id": 3204, "kind": "user", @@ -345,12 +297,6 @@ } ], "regex": [ - { - "id": 11, - "kind": "team", - "login": "github:rust-lang:libs", - "name": "libs" - }, { "id": 19, "kind": "team", @@ -362,6 +308,12 @@ "kind": "user", "login": "BurntSushi", "name": "Andrew Gallant" + }, + { + "id": 55123, + "kind": "user", + "login": "rust-lang-owner", + "name": null } ], "regex-automata": [ @@ -370,15 +322,15 @@ "kind": "user", "login": "BurntSushi", "name": "Andrew Gallant" + }, + { + "id": 55123, + "kind": "user", + "login": "rust-lang-owner", + "name": null } ], "regex-syntax": [ - { - "id": 11, - "kind": "team", - "login": "github:rust-lang:libs", - "name": "libs" - }, { "id": 19, "kind": "team", @@ -390,6 +342,12 @@ "kind": "user", "login": "BurntSushi", "name": "Andrew Gallant" + }, + { + "id": 55123, + "kind": "user", + "login": "rust-lang-owner", + "name": null } ], "rustix": [