Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix deprecations from toml_edit #12421

Merged
merged 3 commits into from Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion crates/bevy_macro_utils/Cargo.toml
Expand Up @@ -9,7 +9,9 @@ license = "MIT OR Apache-2.0"
keywords = ["bevy"]

[dependencies]
toml_edit = { version = "0.22", default-features = false, features = ["parse"] }
toml_edit = { version = "0.22.7", default-features = false, features = [
"parse",
] }
syn = "2.0"
quote = "1.0"
rustc-hash = "1.0"
Expand Down
6 changes: 3 additions & 3 deletions crates/bevy_macro_utils/src/bevy_manifest.rs
Expand Up @@ -2,11 +2,11 @@ extern crate proc_macro;

use proc_macro::TokenStream;
use std::{env, path::PathBuf};
use toml_edit::{Document, Item};
use toml_edit::{DocumentMut, Item};

/// The path to the `Cargo.toml` file for the Bevy project.
pub struct BevyManifest {
manifest: Document,
manifest: DocumentMut,
}

impl Default for BevyManifest {
Expand All @@ -25,7 +25,7 @@ impl Default for BevyManifest {
let manifest = std::fs::read_to_string(path.clone()).unwrap_or_else(|_| {
panic!("Unable to read cargo manifest: {}", path.display())
});
manifest.parse::<Document>().unwrap_or_else(|_| {
manifest.parse::<DocumentMut>().unwrap_or_else(|_| {
panic!("Failed to parse cargo manifest: {}", path.display())
})
})
Expand Down
4 changes: 3 additions & 1 deletion tools/build-templated-pages/Cargo.toml
Expand Up @@ -10,7 +10,9 @@ license = "MIT OR Apache-2.0"
workspace = true

[dependencies]
toml_edit = { version = "0.22", default-features = false, features = ["parse"] }
toml_edit = { version = "0.22.7", default-features = false, features = [
"parse",
] }
tera = "1.15"
serde = { version = "1.0", features = ["derive"] }
bitflags = "2.3"
Expand Down
6 changes: 3 additions & 3 deletions tools/build-templated-pages/src/examples.rs
Expand Up @@ -3,7 +3,7 @@ use std::{cmp::Ordering, fs::File};
use hashbrown::HashMap;
use serde::Serialize;
use tera::{Context, Tera};
use toml_edit::Document;
use toml_edit::DocumentMut;

use crate::Command;

Expand Down Expand Up @@ -40,7 +40,7 @@ impl PartialOrd for Example {

fn parse_examples(panic_on_missing: bool) -> Vec<Example> {
let manifest_file = std::fs::read_to_string("Cargo.toml").unwrap();
let manifest = manifest_file.parse::<Document>().unwrap();
let manifest = manifest_file.parse::<DocumentMut>().unwrap();
let metadatas = manifest
.get("package")
.unwrap()
Expand Down Expand Up @@ -83,7 +83,7 @@ fn parse_examples(panic_on_missing: bool) -> Vec<Example> {

fn parse_categories() -> HashMap<Box<str>, String> {
let manifest_file = std::fs::read_to_string("Cargo.toml").unwrap();
let manifest = manifest_file.parse::<Document>().unwrap();
let manifest = manifest_file.parse::<DocumentMut>().unwrap();
manifest
.get("package")
.unwrap()
Expand Down
4 changes: 2 additions & 2 deletions tools/build-templated-pages/src/features.rs
Expand Up @@ -2,7 +2,7 @@ use std::{cmp::Ordering, fs::File};

use serde::Serialize;
use tera::{Context, Tera};
use toml_edit::Document;
use toml_edit::DocumentMut;

use crate::Command;

Expand All @@ -27,7 +27,7 @@ impl PartialOrd for Feature {

fn parse_features(panic_on_missing: bool) -> Vec<Feature> {
let manifest_file = std::fs::read_to_string("Cargo.toml").unwrap();
let manifest = manifest_file.parse::<Document>().unwrap();
let manifest = manifest_file.parse::<DocumentMut>().unwrap();

let features = manifest["features"].as_table().unwrap();
let default: Vec<_> = features
Expand Down
4 changes: 3 additions & 1 deletion tools/example-showcase/Cargo.toml
Expand Up @@ -13,5 +13,7 @@ workspace = true
xshell = "0.2"
clap = { version = "4.0", features = ["derive"] }
ron = "0.8"
toml_edit = { version = "0.22", default-features = false, features = ["parse"] }
toml_edit = { version = "0.22.7", default-features = false, features = [
"parse",
] }
pbr = "1.1"
4 changes: 2 additions & 2 deletions tools/example-showcase/src/main.rs
Expand Up @@ -14,7 +14,7 @@ use std::{

use clap::{error::ErrorKind, CommandFactory, Parser, ValueEnum};
use pbr::ProgressBar;
use toml_edit::Document;
use toml_edit::DocumentMut;
use xshell::{cmd, Shell};

#[derive(Parser, Debug)]
Expand Down Expand Up @@ -661,7 +661,7 @@ header_message = \"Examples ({})\"

fn parse_examples() -> Vec<Example> {
let manifest_file = fs::read_to_string("Cargo.toml").unwrap();
let manifest = manifest_file.parse::<Document>().unwrap();
let manifest = manifest_file.parse::<DocumentMut>().unwrap();
let metadatas = manifest
.get("package")
.unwrap()
Expand Down