From 3399662c76ebe249312c8394b86d38770c9291d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=96R=C3=96K=20Attila?= Date: Thu, 14 Mar 2024 16:15:37 +0100 Subject: [PATCH] desktop: Follow `Document` -> `DocumentMut` change in `toml_edit` --- desktop/src/preferences.rs | 4 ++-- desktop/src/preferences/read.rs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/desktop/src/preferences.rs b/desktop/src/preferences.rs index 96a2f2d975291..62775de77055f 100644 --- a/desktop/src/preferences.rs +++ b/desktop/src/preferences.rs @@ -10,7 +10,7 @@ use ruffle_core::backend::ui::US_ENGLISH; use ruffle_render_wgpu::clap::{GraphicsBackend, PowerPreference}; use std::sync::{Arc, Mutex}; use sys_locale::get_locale; -use toml_edit::Document; +use toml_edit::DocumentMut; use unic_langid::LanguageIdentifier; /// The preferences that relate to the application itself. @@ -154,7 +154,7 @@ impl GlobalPreferences { #[derive(Default)] struct PreferencesAndDocument { /// The original toml document - toml_document: Document, + toml_document: DocumentMut, /// The actual preferences stored within the toml document, as this version of Ruffle understands them. values: SavedGlobalPreferences, diff --git a/desktop/src/preferences/read.rs b/desktop/src/preferences/read.rs index 8c6583a75063c..9f3e4089bc2ff 100644 --- a/desktop/src/preferences/read.rs +++ b/desktop/src/preferences/read.rs @@ -1,6 +1,6 @@ use crate::preferences::SavedGlobalPreferences; use std::str::FromStr; -use toml_edit::{Document, Item}; +use toml_edit::{DocumentMut, Item}; #[derive(Debug, PartialEq)] pub struct ParseResult { @@ -23,16 +23,16 @@ impl ParseResult { /// Default values are used wherever an unknown or invalid value is found; /// this is to support the case of, for example, a later version having different supported /// backends than an older version. -pub fn read_preferences(input: &str) -> (ParseResult, Document) { +pub fn read_preferences(input: &str) -> (ParseResult, DocumentMut) { let mut result = ParseResult { result: Default::default(), warnings: vec![], }; - let document = match input.parse::() { + let document = match input.parse::() { Ok(document) => document, Err(e) => { result.add_warning(format!("Invalid TOML: {e}")); - return (result, Document::default()); + return (result, DocumentMut::default()); } };