Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 7 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions external-crates/move/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ serde-name = "0.1.1"
serde-reflection = "0.4"
serde_bytes = "0.11.5"
serde_json = "1.0.64"
serde_spanned = "0.6.8"
serde_spanned = { version = "0.6.9", features = ["serde"] }
serde_with = "3.9.0"
serde_yaml = "0.8.26"
sha2 = "0.9.3"
Expand All @@ -112,7 +112,7 @@ thiserror = "1.0.24"
tiny-keccak = { version = "2.0.2", features = ["sha3"] }
tokio = { version = "1.46.1", features = ["full"] }
toml = "0.5.8"
toml_edit = { version = "0.14.3", features = ["easy"] }
toml_edit = { version = "0.22.24", features = ["serde", "default"] }
tracing = "0.1.26"
tracing-subscriber = { version = "0.3.15", features = ["env-filter"] }
treeline = "0.1.0"
Expand Down
3 changes: 0 additions & 3 deletions external-crates/move/crates/move-package-alt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,3 @@ serde.workspace = true
serde_spanned.workspace = true
toml.workspace = true
toml_edit.workspace = true

[package.metadata.cargo-udeps.ignore]
normal = ["serde", "serde_spanned", "toml", "toml_edit"]
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use serde::{Deserialize, Serialize};
use serde_spanned::Spanned;
use toml_edit::{
visit_mut::{visit_table_like_kv_mut, visit_table_mut, VisitMut},
Document, InlineTable, Item, KeyMut, Table, Value,
DocumentMut, InlineTable, Item, KeyMut, Table, Value,
};

use crate::{
Expand Down Expand Up @@ -177,7 +177,7 @@ impl<F: MoveFlavor> Publication<F> {

/// Replace every inline table in [toml] with an implicit standard table (implicit tables are not
/// included if they have no keys directly inside them)
fn expand_toml(toml: &mut Document) {
fn expand_toml(toml: &mut DocumentMut) {
struct Expander;

impl VisitMut for Expander {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use move_compiler::{
shared::{PackagePaths, files::MappedFiles},
};
use move_symbol_pool::Symbol;
use toml_edit::{Document, value};
use toml_edit::{DocumentMut, value};
use vfs::VfsPath;

use super::{
Expand Down Expand Up @@ -295,7 +295,7 @@ impl<'a> BuildPlan<'a> {
pub fn record_package_edition(&self, edition: Edition) -> anyhow::Result<()> {
let move_toml_path = resolve_move_manifest_path(&self.root_package_path());
let mut toml = std::fs::read_to_string(move_toml_path.clone())?
.parse::<Document>()
.parse::<DocumentMut>()
.expect("Failed to read TOML file to update edition");
toml[PACKAGE_NAME][EDITION_NAME] = value(edition.to_string());
std::fs::write(move_toml_path, toml.to_string())?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ pub fn update_dependency_graph(
use toml_edit::value;
let mut toml_string = String::new();
file.read_to_string(&mut toml_string)?;
let mut toml = toml_string.parse::<toml_edit::Document>()?;
let mut toml = toml_string.parse::<toml_edit::DocumentMut>()?;
let move_table = toml
.entry("move")
.or_insert(Item::Table(toml_edit::Table::new()))
Expand Down Expand Up @@ -306,7 +306,7 @@ pub fn update_compiler_toolchain(
) -> Result<()> {
let mut toml_string = String::new();
file.read_to_string(&mut toml_string)?;
let mut toml = toml_string.parse::<toml_edit::Document>()?;
let mut toml = toml_string.parse::<toml_edit::DocumentMut>()?;
let move_table = toml["move"].as_table_mut().ok_or(std::fmt::Error)?;
let toolchain_version = toml::Value::try_from(ToolchainVersion {
compiler_version,
Expand Down Expand Up @@ -364,10 +364,10 @@ pub enum ManagedAddressUpdate {
/// raw utility for preparing package publishing and package upgrades.
/// Invariant: callers maintain a valid hex `id`.
pub fn set_original_id(file: &mut LockFile, environment: &str, id: &str) -> Result<()> {
use toml_edit::{Document, value};
use toml_edit::{DocumentMut, value};
let mut toml_string = String::new();
file.read_to_string(&mut toml_string)?;
let mut toml = toml_string.parse::<Document>()?;
let mut toml = toml_string.parse::<DocumentMut>()?;
let env_table = toml
.get_mut(ENV_TABLE_NAME)
.and_then(|item| item.as_table_mut())
Expand All @@ -391,11 +391,11 @@ pub fn update_managed_address(
environment: &str,
managed_address_update: ManagedAddressUpdate,
) -> Result<()> {
use toml_edit::{Document, Table, value};
use toml_edit::{DocumentMut, Table, value};

let mut toml_string = String::new();
file.read_to_string(&mut toml_string)?;
let mut toml = toml_string.parse::<Document>()?;
let mut toml = toml_string.parse::<DocumentMut>()?;

let env_table = toml
.entry(ENV_TABLE_NAME)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1339,7 +1339,7 @@ impl DependencyGraph {
let mut dev_dependencies = None;
let mut packages = None;
if !writer.is_empty() {
let toml = writer.parse::<toml_edit::Document>()?;
let toml = writer.parse::<toml_edit::DocumentMut>()?;
if let Some(value) = toml.get("dependencies").and_then(|v| v.as_value()) {
dependencies = Some(value.clone());
}
Expand Down
Loading