Skip to content

Commit

Permalink
Fix use of deprecated symbols
Browse files Browse the repository at this point in the history
The toml_edit dependency is required for reading board_config.toml
  • Loading branch information
ogoffart committed Mar 11, 2024
1 parent 76ac137 commit 80b2ac1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ resvg = { version= "0.40.0", default-features = false, features = ["text"] }
send_wrapper = { version = "0.6.0" }
softbuffer = { version = "0.3.3", default-features = false }
strum = { version = "0.26.1", default-features = false, features = ["derive"] }
toml_edit = { version = "0.22" }
toml_edit = { version = "0.22.7" }
cfg_aliases = { version = "0.2.0" }

[profile.release]
Expand Down
2 changes: 1 addition & 1 deletion api/rs/build/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ pub fn print_rustc_flags() -> std::io::Result<()> {
std::env::var_os("DEP_MCU_BOARD_SUPPORT_BOARD_CONFIG_PATH").map(std::path::PathBuf::from)
{
let config = std::fs::read_to_string(board_config_path.as_path())?;
let toml = config.parse::<toml_edit::Document>().expect("invalid board config toml");
let toml = config.parse::<toml_edit::DocumentMut>().expect("invalid board config toml");

for link_arg in
toml.get("link_args").and_then(toml_edit::Item::as_array).into_iter().flatten()
Expand Down
2 changes: 1 addition & 1 deletion xtask/src/license_headers_check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ impl CargoDependency {

struct CargoToml {
path: std::path::PathBuf,
doc: toml_edit::Document,
doc: toml_edit::DocumentMut,
edited: bool,
}

Expand Down
5 changes: 3 additions & 2 deletions xtask/src/nodepackage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub fn generate(sha1: Option<String>) -> Result<(), Box<dyn std::error::Error>>

let workspace_source =
sh.read_file(root.join("Cargo.toml")).context("Failed to read workspace Cargo.toml")?;
let workspace_toml: toml_edit::Document =
let workspace_toml: toml_edit::DocumentMut =
workspace_source.parse().context("Error parsing workspace Cargo.toml")?;

let workspace_package_fields = workspace_toml
Expand All @@ -66,7 +66,8 @@ pub fn generate(sha1: Option<String>) -> Result<(), Box<dyn std::error::Error>>
let toml_source =
sh.read_file(cargo_toml_path.clone()).context("Failed to read Node Cargo.toml")?;

let mut toml: toml_edit::Document = toml_source.parse().context("Error parsing Cargo.toml")?;
let mut toml: toml_edit::DocumentMut =
toml_source.parse().context("Error parsing Cargo.toml")?;

// Replace workspace fields
let package_table = toml["package"]
Expand Down

0 comments on commit 80b2ac1

Please sign in to comment.