Skip to content

Commit

Permalink
fix: rust idiomatic file parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Nov 27, 2024
1 parent aba8c04 commit 8bae0bc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion e2e/plugins/core/test_rust
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,11 @@
export MISE_RUSTUP_HOME="$MISE_DATA_DIR/rustup"
export MISE_CARGO_HOME="$MISE_DATA_DIR/cargo"

assert_contains "mise x rust@1.82.0 -- rustc --version" "rustc 1.82.0"
assert_contains "mise x rust@1.81.0 -- rustc --version" "rustc 1.81.0"

cat <<EOF >rust-toolchain.toml
[toolchain]
channel = "1.81.0"
EOF

assert_contains "mise x -- rustc --version" "rustc 1.81.0"
2 changes: 1 addition & 1 deletion src/plugins/core/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl Backend for RustPlugin {
let toml = toml.parse::<toml::Value>()?;
if let Some(toolchain) = toml.get("toolchain") {
if let Some(channel) = toolchain.get("channel") {
return Ok(channel.to_string());
return Ok(channel.as_str().unwrap().to_string());
}
}
Ok("".into())
Expand Down

0 comments on commit 8bae0bc

Please sign in to comment.