Skip to content

Commit f27012a

Browse files
committed
Use toml instead of toml_edit
1 parent 38908d4 commit f27012a

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "macrotest"
33
version = "1.1.0"
44
authors = ["eupn <[email protected]>"]
55
edition = "2018"
6-
rust-version = "1.65"
6+
rust-version = "1.66"
77
license = "MIT OR Apache-2.0"
88
readme = "README.md"
99
repository = "https://github.com/eupn/macrotest"
@@ -18,4 +18,4 @@ serde = "1.0.105"
1818
serde_derive = "1.0.105"
1919
serde_json = "1.0"
2020
syn = { version = "2", features = ["full"] }
21-
toml_edit = { version = "0.22", features = ["serde"] }
21+
toml = "0.9"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
Similar to [trybuild], but allows you to test how declarative or procedural macros are expanded.
1111

12-
*Minimal Supported Rust Version: 1.65*
12+
*Minimal Supported Rust Version: 1.66*
1313

1414
----
1515

src/dependencies.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub(crate) fn get_manifest(manifest_dir: &Path) -> Manifest {
1818
fn try_get_manifest(manifest_dir: &Path) -> Result<Manifest, Error> {
1919
let cargo_toml_path = manifest_dir.join("Cargo.toml");
2020
let manifest_str = fs::read_to_string(cargo_toml_path)?;
21-
let mut manifest: Manifest = toml_edit::de::from_str(&manifest_str)?;
21+
let mut manifest: Manifest = toml::de::from_str(&manifest_str)?;
2222

2323
fix_dependencies(&mut manifest.dependencies, manifest_dir);
2424
fix_dependencies(&mut manifest.dev_dependencies, manifest_dir);
@@ -33,7 +33,7 @@ pub(crate) fn get_workspace_manifest(manifest_dir: &Path) -> WorkspaceManifest {
3333
pub(crate) fn try_get_workspace_manifest(manifest_dir: &Path) -> Result<WorkspaceManifest, Error> {
3434
let cargo_toml_path = manifest_dir.join("Cargo.toml");
3535
let manifest_str = fs::read_to_string(cargo_toml_path)?;
36-
let mut manifest: WorkspaceManifest = toml_edit::de::from_str(&manifest_str)?;
36+
let mut manifest: WorkspaceManifest = toml::de::from_str(&manifest_str)?;
3737

3838
fix_dependencies(&mut manifest.workspace.dependencies, manifest_dir);
3939
fix_patches(&mut manifest.patch, manifest_dir);

src/error.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ pub(crate) enum Error {
55
CargoFail,
66
CargoMetadata(serde_json::error::Error),
77
Io(std::io::Error),
8-
TomlSer(toml_edit::ser::Error),
9-
TomlDe(toml_edit::de::Error),
8+
TomlSer(toml::ser::Error),
9+
TomlDe(toml::de::Error),
1010
Glob(glob::GlobError),
1111
GlobPattern(glob::PatternError),
1212
ManifestDir,
@@ -47,14 +47,14 @@ impl From<std::io::Error> for Error {
4747
}
4848
}
4949

50-
impl From<toml_edit::ser::Error> for Error {
51-
fn from(e: toml_edit::ser::Error) -> Self {
50+
impl From<toml::ser::Error> for Error {
51+
fn from(e: toml::ser::Error) -> Self {
5252
Error::TomlSer(e)
5353
}
5454
}
5555

56-
impl From<toml_edit::de::Error> for Error {
57-
fn from(e: toml_edit::de::Error) -> Self {
56+
impl From<toml::de::Error> for Error {
57+
fn from(e: toml::de::Error) -> Self {
5858
Error::TomlDe(e)
5959
}
6060
}

src/expand.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,10 @@ fn prepare(tests: &[ExpandedTest]) -> Result<Project> {
218218
};
219219

220220
let manifest = make_manifest(crate_name, &project, tests)?;
221-
let manifest_toml = toml_edit::ser::to_string(&manifest)?;
221+
let manifest_toml = toml::ser::to_string(&manifest)?;
222222

223223
let config = make_config();
224-
let config_toml = toml_edit::ser::to_string(&config)?;
224+
let config_toml = toml::ser::to_string(&config)?;
225225

226226
if let Some(enabled_features) = &mut project.features {
227227
enabled_features.retain(|feature| manifest.features.contains_key(feature));

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//!
55
//! Similar to [trybuild], but allows you to write tests on how macros are expanded.
66
//!
7-
//! *Minimal Supported Rust Version: 1.65*
7+
//! *Minimal Supported Rust Version: 1.66*
88
//!
99
//! <br>
1010
//!

0 commit comments

Comments
 (0)