on master help sign in
Fix compatibility with toml 0.6.0

`toml::from_slice` has been removed. The CHANGELOG recommends using `toml::from_str` instead and doing the byte-to-str conversion yourself. The `toml::toml!` macro has also changed to return the type of the value declared within the macro body. In the change in `helix-view/src/theme.rs` this is a `toml::map::Map` (it was a `toml::Value` previously) allowing us to skip the match and use the map directly. Co-authored-by: Pascal Kuthe <pascal.kuthe@semimod.de>

commitb3e9f6233a64bb08dcb87788d5ca54dd25f13a27 authorMichael Davis <mcarsondavis@gmail.com> dateTue 24 Jan 2023, 11:11 (4 years ago) parent52d854f
2 files changed+4−6
helix-core/tests/indent.rs+2−2 helix-view/src/theme.rs+2−4
helix-core/tests/indent.rs+2−2
@@ -28,8 +28,8 @@ fn test_treesitter_indent(file_name: &str, lang_scope: &str) {
2828
2929 let mut config_file = test_dir;
3030 config_file.push("languages.toml");
31− let config = std::fs::read(config_file).unwrap();
32− let config = toml::from_slice(&config).unwrap();
31+ let config = std::fs::read_to_string(config_file).unwrap();
32+ let config = toml::from_str(&config).unwrap();
3333 let loader = Loader::new(config);
3434
3535 // set runtime path so we can find the queries
helix-view/src/theme.rs+2−4
@@ -517,10 +517,8 @@ mod tests {
517517
518518 let mut style = Style::default();
519519 let palette = ThemePalette::default();
520− if let Value::Table(entries) = table {
521− for (_name, value) in entries {
522− palette.parse_style(&mut style, value).unwrap();
523− }
520+ for (_name, value) in table {
521+ palette.parse_style(&mut style, value).unwrap();
524522 }
525523
526524 assert_eq!(