chore(deps): update rust crate toml to 0.9#16
Conversation
WalkthroughDependency versions are bumped across multiple Tauri crates: Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Fix all issues with AI agents
In `@crates/tauri-utils/src/config.rs`:
- Line 180: The Display implementation for the bundle enum returns "Flatpak"
while all other variants use lowercase; update the match arm for Self::Flatpak
in the Display impl (in config.rs) to return "flatpak" to match the casing of
other variants (e.g., "deb", "rpm", "appimage") so Display output is consistent
for case-sensitive comparisons and serialization round-trips.
In `@crates/tauri-utils/src/config/parse.rs`:
- Around line 385-391: The TOML parser in do_parse_toml is mapping
toml::from_str errors to ConfigError::FormatJson, producing misleading "JSON"
errors; change the error mapping to use ConfigError::FormatToml instead so the
actual toml::de::Error is preserved (i.e., when ::toml::from_str(raw) fails
return ConfigError::FormatToml with path: path.into() and the toml error),
matching the existing ConfigError variant and the implementation in
config_v1::parse.rs.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (6)
crates/tauri-build/Cargo.tomlcrates/tauri-cli/Cargo.tomlcrates/tauri-plugin/Cargo.tomlcrates/tauri-utils/Cargo.tomlcrates/tauri-utils/src/config.rscrates/tauri-utils/src/config/parse.rs
🔇 Additional comments (5)
crates/tauri-plugin/Cargo.toml (1)
38-38: LGTM!The optional
tomldependency version bump is consistent with the workspace-wide update.crates/tauri-utils/Cargo.toml (1)
37-37: LGTM!The
tomldependency version bump with theparsefeature is consistent with the workspace-wide update.crates/tauri-utils/src/config.rs (1)
147-148: NewFlatpakbundle type addition looks good.The implementation correctly adds the new variant to
all()and handles case-insensitive deserialization.crates/tauri-cli/Cargo.toml (1)
59-68: Dependency updates look correct.The
toml_edit0.23 andtoml0.9 versions share underlying parsing infrastructure—thetomlcrate now usestoml_editas its formatting-preserving parsing and display backend, withtomllayering the serde-friendly Value API on top. The feature additions fortauri-utils(schema, config-json5, config-toml) align with extending config parsing capabilities.crates/tauri-build/Cargo.toml (1)
46-46: Dependency version bump looks good.The
tomlcrate update from 0.8 to 0.9 aligns with the PR objective.cargo_toml0.22 (used in this crate) is compatible withtoml0.9, and since the code uses thecargo_tomlwrapper API rather than directtomlcalls, no code changes are needed.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
| Self::Nsis => "nsis", | ||
| Self::App => "app", | ||
| Self::Dmg => "dmg", | ||
| Self::Flatpak => "Flatpak", |
There was a problem hiding this comment.
Inconsistent casing in Display implementation.
All other bundle types use lowercase in their Display output ("deb", "rpm", "appimage", etc.), but Flatpak uses title case. This inconsistency could cause issues if the Display output is used for case-sensitive comparisons or serialization round-trips.
Proposed fix for consistency
- Self::Flatpak => "Flatpak",
+ Self::Flatpak => "flatpak",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| Self::Flatpak => "Flatpak", | |
| Self::Flatpak => "flatpak", |
🤖 Prompt for AI Agents
In `@crates/tauri-utils/src/config.rs` at line 180, The Display implementation for
the bundle enum returns "Flatpak" while all other variants use lowercase; update
the match arm for Self::Flatpak in the Display impl (in config.rs) to return
"flatpak" to match the casing of other variants (e.g., "deb", "rpm", "appimage")
so Display output is consistent for case-sensitive comparisons and serialization
round-trips.
| fn do_parse_toml<D: DeserializeOwned>(raw: &str, path: &Path) -> Result<D, ConfigError> { | ||
| ::toml::from_str(raw).map_err(|error| ConfigError::FormatToml { | ||
| // Parse using toml 0.9's from_str which returns different error types | ||
| ::toml::from_str(raw).map_err(|error| ConfigError::FormatJson { | ||
| path: path.into(), | ||
| error: Box::new(error), | ||
| error: serde_json::Error::custom(error.to_string()), | ||
| }) | ||
| } |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
cd crates/tauri-utils/src/config && head -120 parse.rs | tail -40Repository: qodo-benchmark/tauri-combined-coderabbit
Length of output: 1333
🏁 Script executed:
cd crates/tauri-utils/src/config && sed -n '80,115p' parse.rsRepository: qodo-benchmark/tauri-combined-coderabbit
Length of output: 1106
🏁 Script executed:
cd crates/tauri-utils/src && find . -name "*.rs" -exec grep -l "ConfigError" {} \; | head -5Repository: qodo-benchmark/tauri-combined-coderabbit
Length of output: 122
🏁 Script executed:
cd crates/tauri-utils/src && grep -n "enum ConfigError" -A 30 config.rsRepository: qodo-benchmark/tauri-combined-coderabbit
Length of output: 66
🏁 Script executed:
cd crates/tauri-utils/src/config && sed -n '385,395p' parse.rsRepository: qodo-benchmark/tauri-combined-coderabbit
Length of output: 625
🏁 Script executed:
cd crates/tauri-utils/src/config && sed -n '1,20p' parse.rsRepository: qodo-benchmark/tauri-combined-coderabbit
Length of output: 778
🏁 Script executed:
cd crates/tauri-utils/src/config && grep -n "do_parse_toml" -B 5 -A 8 parse.rsRepository: qodo-benchmark/tauri-combined-coderabbit
Length of output: 1068
🏁 Script executed:
cd crates/tauri-utils/src/config && grep -n "FormatToml" parse.rsRepository: qodo-benchmark/tauri-combined-coderabbit
Length of output: 102
🏁 Script executed:
cd crates/tauri-utils && grep -r "ConfigError::FormatToml" --include="*.rs"Repository: qodo-benchmark/tauri-combined-coderabbit
Length of output: 172
🏁 Script executed:
cd crates/tauri-utils/src/config_v1 && head -5 parse.rs && echo "---" && grep -n "do_parse_toml" -B 5 -A 8 parse.rsRepository: qodo-benchmark/tauri-combined-coderabbit
Length of output: 1195
🏁 Script executed:
cd crates/tauri-utils/src && ls -la config*/Repository: qodo-benchmark/tauri-combined-coderabbit
Length of output: 513
🏁 Script executed:
cd crates/tauri-utils/src/config && git log --oneline -10 parse.rs 2>/dev/null || echo "Not a git repo or file not tracked"Repository: qodo-benchmark/tauri-combined-coderabbit
Length of output: 102
🏁 Script executed:
cd crates/tauri-utils && grep -n "toml" Cargo.tomlRepository: qodo-benchmark/tauri-combined-coderabbit
Length of output: 155
🏁 Script executed:
cd crates/tauri-utils/src/config && grep -n "use.*toml" parse.rsRepository: qodo-benchmark/tauri-combined-coderabbit
Length of output: 66
🏁 Script executed:
cd crates/tauri-utils/src/config && sed -n '103,115p' parse.rsRepository: qodo-benchmark/tauri-combined-coderabbit
Length of output: 484
TOML parse errors are incorrectly reported as JSON errors.
The do_parse_toml function maps TOML parsing failures to ConfigError::FormatJson, which displays misleading error messages to users like "unable to parse JSON Tauri config file" when they have syntax errors in their tauri.toml file.
The existing ConfigError::FormatToml variant is properly defined with type Box<::toml::de::Error> and should be used instead. Update the function to:
fn do_parse_toml<D: DeserializeOwned>(raw: &str, path: &Path) -> Result<D, ConfigError> {
::toml::from_str(raw).map_err(|error| ConfigError::FormatToml {
path: path.into(),
error,
})
}This matches the correct implementation in config_v1/parse.rs and preserves error fidelity.
🤖 Prompt for AI Agents
In `@crates/tauri-utils/src/config/parse.rs` around lines 385 - 391, The TOML
parser in do_parse_toml is mapping toml::from_str errors to
ConfigError::FormatJson, producing misleading "JSON" errors; change the error
mapping to use ConfigError::FormatToml instead so the actual toml::de::Error is
preserved (i.e., when ::toml::from_str(raw) fails return ConfigError::FormatToml
with path: path.into() and the toml error), matching the existing ConfigError
variant and the implementation in config_v1::parse.rs.
Benchmark PR from qodo-benchmark#174
Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.