diff --git a/Cargo.lock b/Cargo.lock index e99b3c0383f..469d2a4294a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2059,7 +2059,7 @@ dependencies = [ "term-table", "tokio", "toml 0.8.19", - "toml_edit 0.21.1", + "toml_edit 0.22.20", "tracing", "url", "uwuify", @@ -2106,7 +2106,7 @@ dependencies = [ "sway-utils", "tempfile", "tokio", - "toml_edit 0.21.1", + "toml_edit 0.22.20", "tracing", ] @@ -6977,7 +6977,7 @@ dependencies = [ "thiserror", "tikv-jemallocator", "tokio", - "toml_edit 0.21.1", + "toml_edit 0.22.20", "tower 0.4.13", "tower-lsp", "tracing", diff --git a/Cargo.toml b/Cargo.toml index 95b4809a0dd..8748266c857 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -218,7 +218,7 @@ thiserror = "1.0" tikv-jemallocator = "0.5" tokio = "1.12" toml = "0.8" -toml_edit = "0.21" +toml_edit = "0.22" tower = { version = "0.5", default-features = false } tower-lsp = "0.20" tracing = "0.1" diff --git a/forc-plugins/forc-client/src/util/pkg.rs b/forc-plugins/forc-client/src/util/pkg.rs index 3aa8f6b2236..c93df24bacc 100644 --- a/forc-plugins/forc-client/src/util/pkg.rs +++ b/forc-plugins/forc-client/src/util/pkg.rs @@ -26,7 +26,7 @@ pub(crate) fn update_proxy_address_in_manifest( let mut toml = String::new(); let mut file = File::open(manifest.path())?; file.read_to_string(&mut toml)?; - let mut manifest_toml = toml.parse::()?; + let mut manifest_toml = toml.parse::()?; if manifest.proxy().is_some() { manifest_toml["proxy"]["address"] = toml_edit::value(address); let mut file = std::fs::OpenOptions::new() diff --git a/forc-plugins/forc-client/tests/deploy.rs b/forc-plugins/forc-client/tests/deploy.rs index c0016c74c67..0a31fb91ccb 100644 --- a/forc-plugins/forc-client/tests/deploy.rs +++ b/forc-plugins/forc-client/tests/deploy.rs @@ -23,7 +23,7 @@ use std::{ str::FromStr, }; use tempfile::tempdir; -use toml_edit::{value, Document, InlineTable, Item, Table, Value}; +use toml_edit::{value, DocumentMut, InlineTable, Item, Table, Value}; fn get_workspace_root() -> PathBuf { PathBuf::from(env!("CARGO_MANIFEST_DIR")) @@ -75,7 +75,7 @@ fn patch_manifest_file_with_path_std(manifest_dir: &Path) -> anyhow::Result<()> let toml_path = manifest_dir.join(sway_utils::constants::MANIFEST_FILE_NAME); let toml_content = fs::read_to_string(&toml_path).unwrap(); - let mut doc = toml_content.parse::().unwrap(); + let mut doc = toml_content.parse::().unwrap(); let new_std_path = get_workspace_root().join("sway-lib-std"); let mut std_dependency = InlineTable::new(); @@ -89,7 +89,7 @@ fn patch_manifest_file_with_path_std(manifest_dir: &Path) -> anyhow::Result<()> fn patch_manifest_file_with_proxy_table(manifest_dir: &Path, proxy: Proxy) -> anyhow::Result<()> { let toml_path = manifest_dir.join(sway_utils::constants::MANIFEST_FILE_NAME); let toml_content = fs::read_to_string(&toml_path)?; - let mut doc = toml_content.parse::()?; + let mut doc = toml_content.parse::()?; let proxy_table = doc.entry("proxy").or_insert(Item::Table(Table::new())); let proxy_table = proxy_table.as_table_mut().unwrap(); diff --git a/forc/src/ops/forc_template.rs b/forc/src/ops/forc_template.rs index 23703ea575e..0304a9d298a 100644 --- a/forc/src/ops/forc_template.rs +++ b/forc/src/ops/forc_template.rs @@ -84,7 +84,7 @@ fn edit_forc_toml(out_dir: &Path, project_name: &str, real_name: &str) -> Result let mut file = File::open(out_dir.join(constants::MANIFEST_FILE_NAME))?; let mut toml = String::new(); file.read_to_string(&mut toml)?; - let mut manifest_toml = toml.parse::()?; + let mut manifest_toml = toml.parse::()?; let mut authors = Vec::new(); let forc_toml: toml::Value = toml::de::from_str(&toml)?; @@ -144,7 +144,7 @@ fn edit_cargo_toml(out_dir: &Path, project_name: &str, real_name: &str) -> Resul } updated_authors.push(real_name); - let mut manifest_toml = toml.parse::()?; + let mut manifest_toml = toml.parse::()?; manifest_toml["package"]["authors"] = toml_edit::value(updated_authors); manifest_toml["package"]["name"] = toml_edit::value(project_name); diff --git a/sway-lsp/src/core/sync.rs b/sway-lsp/src/core/sync.rs index f00189880fe..5a49c638467 100644 --- a/sway-lsp/src/core/sync.rs +++ b/sway-lsp/src/core/sync.rs @@ -286,7 +286,7 @@ pub(crate) fn edit_manifest_dependency_paths( if let Ok(mut file) = File::open(manifest.path()) { let mut toml = String::new(); let _ = file.read_to_string(&mut toml); - if let Ok(mut manifest_toml) = toml.parse::() { + if let Ok(mut manifest_toml) = toml.parse::() { for (name, abs_path) in dependency_map { manifest_toml["dependencies"][&name]["path"] = toml_edit::value(abs_path.display().to_string());