From e9dc9f493554bd54ea3710e66a2fb0fd2e70b462 Mon Sep 17 00:00:00 2001 From: Pascal Kuthe Date: Tue, 24 Jan 2023 17:07:01 +0100 Subject: Switch from toml::from_slice to toml::from_str (#5659) --- xtask/src/helpers.rs | 4 ++-- xtask/src/themelint.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'xtask') diff --git a/xtask/src/helpers.rs b/xtask/src/helpers.rs index 4f759e74..f96cdfb3 100644 --- a/xtask/src/helpers.rs +++ b/xtask/src/helpers.rs @@ -39,6 +39,6 @@ pub fn find_files(dir: &Path, filename: &str) -> Vec { } pub fn lang_config() -> LangConfig { - let bytes = std::fs::read(path::lang_config()).unwrap(); - toml::from_slice(&bytes).unwrap() + let text = std::fs::read_to_string(path::lang_config()).unwrap(); + toml::from_str(&text).unwrap() } diff --git a/xtask/src/themelint.rs b/xtask/src/themelint.rs index 06dfae40..e9980574 100644 --- a/xtask/src/themelint.rs +++ b/xtask/src/themelint.rs @@ -156,8 +156,8 @@ pub fn lint(file: String) -> Result<(), DynError> { return Ok(()); } let path = path::themes().join(file.clone() + ".toml"); - let theme = std::fs::read(&path).unwrap(); - let theme: Theme = toml::from_slice(&theme).expect("Failed to parse theme"); + let theme = std::fs::read_to_string(&path).unwrap(); + let theme: Theme = toml::from_str(&theme).expect("Failed to parse theme"); let mut messages: Vec = vec![]; get_rules().iter().for_each(|lint| match lint { -- cgit v1.2.3-70-g09d2