Remove test feature and expose Preset unconditionally
This commit is contained in:
parent
1923d1db1e
commit
0b00fcfff5
11 changed files with 41 additions and 43 deletions
|
|
@ -6,8 +6,7 @@ edition = "2024"
|
|||
publish = false
|
||||
|
||||
[features]
|
||||
test = ["iced/test"]
|
||||
tester = ["test", "iced/tester"]
|
||||
tester = ["iced/tester"]
|
||||
|
||||
[dependencies]
|
||||
iced.workspace = true
|
||||
|
|
|
|||
|
|
@ -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())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue