Skip to content

Commit 093bb0e

Browse files
committed
Eliminate deprecation warnings
1 parent c160081 commit 093bb0e

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

dylint-link/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use std::{
1616
};
1717
#[cfg(target_os = "windows")]
1818
use std::{fs::File, io::Read};
19-
use toml_edit::{Document, Item};
19+
use toml_edit::{DocumentMut, Item};
2020

2121
fn main() -> Result<()> {
2222
env_logger::init();
@@ -45,7 +45,7 @@ fn linker() -> Result<PathBuf> {
4545
config_toml.to_string_lossy()
4646
)
4747
})?;
48-
let document = contents.parse::<Document>()?;
48+
let document = contents.parse::<DocumentMut>()?;
4949
document
5050
.as_table()
5151
.get("target")

examples/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ mod test {
55
clippy_utils::toolchain_channel, examples::iter, rustup::SanitizeEnvironment, CommandExt,
66
};
77
use std::{ffi::OsStr, fs::read_to_string};
8-
use toml_edit::{Document, Item, Value};
8+
use toml_edit::{DocumentMut, Item, Value};
99
use walkdir::WalkDir;
1010

1111
#[test]
@@ -52,7 +52,7 @@ mod test {
5252
}
5353
let config_toml = path.join(".cargo/config.toml");
5454
let contents = read_to_string(config_toml).unwrap();
55-
let mut document = contents.parse::<Document>().unwrap();
55+
let mut document = contents.parse::<DocumentMut>().unwrap();
5656
// smoelius: Hack. `build.target-dir` is expected to be a relative path. Replace it with
5757
// an absolute one. However, the directory might not exist when this test is run. So use
5858
// `cargo_util::paths::normalize_path` rather than `Path::canonicalize`.
@@ -106,7 +106,7 @@ mod test {
106106
let path = path.unwrap();
107107

108108
let contents = read_to_string(path.join("rust-toolchain")).unwrap();
109-
let document = contents.parse::<Document>().unwrap();
109+
let document = contents.parse::<DocumentMut>().unwrap();
110110
let array = document
111111
.as_table()
112112
.get("toolchain")

internal/src/clippy_utils.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::{
44
fs::{read_to_string, write},
55
path::Path,
66
};
7-
use toml_edit::{Document, Item, Value};
7+
use toml_edit::{DocumentMut, Item, Value};
88

99
#[allow(clippy::module_name_repetitions)]
1010
pub fn clippy_utils_version_from_rust_version(rust_version: &str) -> Result<String> {
@@ -22,7 +22,7 @@ pub fn clippy_utils_package_version(path: &Path) -> Result<String> {
2222
cargo_toml.to_string_lossy(),
2323
)
2424
})?;
25-
let document = contents.parse::<Document>()?;
25+
let document = contents.parse::<DocumentMut>()?;
2626
document
2727
.as_table()
2828
.get("package")
@@ -41,7 +41,7 @@ pub fn set_clippy_utils_dependency_revision(path: &Path, rev: &str) -> Result<()
4141
cargo_toml.to_string_lossy(),
4242
)
4343
})?;
44-
let mut document = contents.parse::<Document>()?;
44+
let mut document = contents.parse::<DocumentMut>()?;
4545
// smoelius: First check `dependencies` for `clippy_utils`.
4646
let mut clippy_utils = document
4747
.as_table_mut()
@@ -74,7 +74,7 @@ pub fn toolchain_channel(path: &Path) -> Result<String> {
7474
rust_toolchain.to_string_lossy(),
7575
)
7676
})?;
77-
let document = contents.parse::<Document>()?;
77+
let document = contents.parse::<DocumentMut>()?;
7878
document
7979
.as_table()
8080
.get("toolchain")
@@ -93,7 +93,7 @@ pub fn set_toolchain_channel(path: &Path, channel: &str) -> Result<()> {
9393
rust_toolchain.to_string_lossy(),
9494
)
9595
})?;
96-
let mut document = contents.parse::<Document>()?;
96+
let mut document = contents.parse::<DocumentMut>()?;
9797
document
9898
.as_table_mut()
9999
.get_mut("toolchain")

internal/src/packaging.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ pub fn use_local_packages(path: &Path) -> Result<()> {
120120
mod test {
121121
use super::*;
122122
use std::fs::read_to_string;
123-
use toml_edit::{Document, Item};
123+
use toml_edit::{DocumentMut, Item};
124124

125125
#[cfg_attr(
126126
dylint_lib = "assert_eq_arg_misordering",
@@ -155,7 +155,7 @@ mod test {
155155
let contents =
156156
read_to_string(Path::new(env!("CARGO_MANIFEST_DIR")).join("template/Cargo.toml~"))
157157
.unwrap();
158-
let document = contents.parse::<Document>().unwrap();
158+
let document = contents.parse::<DocumentMut>().unwrap();
159159
let version = document
160160
.as_table()
161161
.get("package")

0 commit comments

Comments
 (0)