Skip to content

Commit 3f731cf

Browse files
committed
Bump to toml v0.9.5
This includes breaking API changes, but no changes to output formatting that are bad enough to break my (basic) tests. It has a new parser and writer, and came out in early July, so it seems like there's been enough time to shake out the major bugs. However, whenever I get around to the xt v0.20.0 release, it might be good to check on this one again.
1 parent 4266544 commit 3f731cf

File tree

3 files changed

+22
-28
lines changed

3 files changed

+22
-28
lines changed

Cargo.lock

Lines changed: 15 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ serde_yaml = "0.9.34"
2222
unsafe-libyaml = "0.2.11"
2323

2424
[dependencies.toml]
25-
version = "0.8.23"
25+
version = "0.9.5"
2626
features = ["preserve_order"]
2727

2828
[target.'cfg(unix)'.dependencies]

src/toml.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ pub(crate) fn input_matches(mut input: Ref) -> io::Result<bool> {
3131
}
3232
};
3333

34-
let input_str = match str::from_utf8(input_buf) {
35-
Ok(input_str) => input_str,
36-
Err(_) => return Ok(false),
34+
let Ok(input_str) = str::from_utf8(input_buf) else {
35+
return Ok(false);
36+
};
37+
let Ok(de) = ::toml::Deserializer::parse(input_str) else {
38+
return Ok(false);
3739
};
38-
39-
let de = ::toml::Deserializer::new(input_str);
4040
Ok(de::IgnoredAny::deserialize(de).is_ok())
4141
}
4242

@@ -45,7 +45,7 @@ where
4545
O: crate::Output,
4646
{
4747
let input: Cow<'_, [u8]> = input.try_into()?;
48-
let de = ::toml::Deserializer::new(str::from_utf8(&input)?);
48+
let de = ::toml::Deserializer::parse(str::from_utf8(&input)?)?;
4949
output.transcode_from(de)
5050
}
5151

0 commit comments

Comments
 (0)