Skip to content

Commit

Permalink
desktop: Follow Document -> DocumentMut change in toml_edit
Browse files Browse the repository at this point in the history
  • Loading branch information
torokati44 committed Mar 14, 2024
1 parent b7a453f commit 1651be7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions desktop/src/preferences.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions desktop/src/preferences/read.rs
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -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::<Document>() {
let document = match input.parse::<DocumentMut>() {
Ok(document) => document,
Err(e) => {
result.add_warning(format!("Invalid TOML: {e}"));
return (result, Document::default());
return (result, DocumentMut::default());
}
};

Expand Down

0 comments on commit 1651be7

Please sign in to comment.