Remove test feature and expose Preset unconditionally

This commit is contained in:
Héctor Ramón Jiménez 2025-08-27 02:33:58 +02:00
parent 1923d1db1e
commit 0b00fcfff5
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
11 changed files with 41 additions and 43 deletions

View file

@ -6,8 +6,7 @@ edition = "2024"
publish = false
[features]
test = ["iced/test"]
tester = ["test", "iced/tester"]
tester = ["iced/tester"]
[dependencies]
iced.workspace = true

View file

@ -5,7 +5,8 @@ use iced::widget::{
};
use iced::window;
use iced::{
Center, Element, Fill, Font, Function, Subscription, Task as Command,
Center, Element, Fill, Font, Function, Preset, Subscription,
Task as Command,
};
use serde::{Deserialize, Serialize};
@ -19,10 +20,8 @@ pub fn main() -> iced::Result {
.subscription(Todos::subscription)
.title(Todos::title)
.font(Todos::ICON_FONT)
.window_size((500.0, 800.0));
#[cfg(feature = "test")]
let todos = todos.presets(presets());
.window_size((500.0, 800.0))
.presets(presets());
todos.run()
}
@ -579,11 +578,7 @@ impl SavedState {
}
}
#[cfg(feature = "test")]
fn presets() -> impl Iterator<Item = iced::application::Preset<Todos, Message>>
{
use iced::application::Preset;
fn presets() -> impl Iterator<Item = Preset<Todos, Message>> {
[
Preset::new("Empty", || {
(Todos::Loaded(State::default()), Command::none())