Capitalize mode value in ice metadata

This commit is contained in:
Héctor Ramón Jiménez 2025-08-20 14:43:37 +02:00
parent c8ccba5535
commit b20168b614
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
3 changed files with 7 additions and 8 deletions

View file

@ -586,10 +586,7 @@ fn presets() -> impl Iterator<Item = iced::application::Preset<Todos, Message>>
[
Preset::new("Empty", || {
(
Todos::Loading,
Command::done(Message::Loaded(Err(LoadError::File))),
)
(Todos::Loaded(State::default()), Command::none())
}),
Preset::new("Carl Sagan", || {
(

View file

@ -1,5 +1,5 @@
viewport: 512x768
mode: impatient
mode: Impatient
preset: Empty
-----
click at "What needs to be done?"
@ -7,6 +7,8 @@ type "Create the universe"
type enter
type "Make an apple pie"
type enter
expect "2 tasks left"
click at "Create the universe"
expect "1 task left"
click at "Make an apple pie"
expect "0 tasks left"

View file

@ -51,7 +51,7 @@ impl Ice {
);
}
"mode" => {
mode = Some(match value.trim() {
mode = Some(match value.trim().to_lowercase().as_str() {
"patient" => emulator::Mode::Patient,
"impatient" => emulator::Mode::Impatient,
_ => {
@ -118,8 +118,8 @@ impl std::fmt::Display for Ice {
f,
"mode: {}",
match self.mode {
emulator::Mode::Patient => "patient",
emulator::Mode::Impatient => "impatient",
emulator::Mode::Patient => "Patient",
emulator::Mode::Impatient => "Impatient",
}
)?;