Skip to content

Commit 6815ebf

Browse files
Snowiiiinabijaczleweli
authored andcommitted
Update toml to 0.9. Update cc to 1.2
1 parent 86ea76e commit 6815ebf

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,14 @@ exclude = ["*.enc"]
4141

4242
[dependencies]
4343
rustc_version = "0.4"
44-
toml = "0.8"
44+
toml = "0.9"
4545

4646
[target.'cfg(not(target_os = "windows"))'.dependencies]
4747
memchr = "2.7"
48-
cc = "1.0"
48+
cc = "1.2"
4949

5050
[target.'cfg(all(target_os = "windows", target_env = "msvc"))'.dependencies]
51-
cc = "1.0"
51+
cc = "1.2"
5252
vswhom = "0.1"
5353

5454
[target.'cfg(all(target_os = "windows", target_env = "msvc"))'.dependencies.winreg]

src/lib.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,8 @@ use std::{env, fs};
150150
use std::ffi::OsStr;
151151
use std::borrow::Cow;
152152
use std::process::Command;
153-
use toml::Value as TomlValue;
153+
use toml::Table as TomlTable;
154154
use std::fmt::{self, Display};
155-
use toml::map::Map as TomlMap;
156155
use std::path::{Path, PathBuf};
157156

158157

@@ -268,14 +267,12 @@ pub fn compile<T: AsRef<Path>, Ms: AsRef<OsStr>, Mi: IntoIterator<Item = Ms>>(re
268267
eprintln!("Couldn't read Cargo.toml: {}; assuming src/main.rs or S_ISDIR(src/bin/)", err);
269268
String::new()
270269
})
271-
.parse::<TomlValue>()
270+
.parse::<TomlTable>()
272271
.unwrap_or_else(|err| {
273272
eprintln!("Couldn't parse Cargo.toml: {}; assuming src/main.rs or S_ISDIR(src/bin/)", err);
274-
TomlValue::Table(TomlMap::new())
273+
TomlTable::new()
275274
})
276-
.as_table()
277-
.map(|t| t.contains_key("bin"))
278-
.unwrap_or(false) || (Path::new("src/main.rs").exists() || Path::new("src/bin").is_dir());
275+
.contains_key("bin") || (Path::new("src/main.rs").exists() || Path::new("src/bin").is_dir());
279276
eprintln!("Final verdict: crate has binaries: {}", hasbins);
280277

281278
if hasbins && rustc_version::version().expect("couldn't get rustc version") >= rustc_version::Version::new(1, 50, 0) {

0 commit comments

Comments
 (0)