Fix failing doctests
This commit is contained in:
parent
dbc1181011
commit
e66120b9c1
|
@ -33,8 +33,18 @@ use std::hash::Hash;
|
||||||
/// Buttons can be disabled by not having an on_press.
|
/// Buttons can be disabled by not having an on_press.
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
|
/// # use iced_native::{button, Text};
|
||||||
|
/// #
|
||||||
|
/// # type Button<'a, Message> =
|
||||||
|
/// # iced_native::Button<'a, Message, iced_native::renderer::Null>;
|
||||||
|
/// #
|
||||||
|
/// # #[derive(Clone)]
|
||||||
|
/// # enum Message {
|
||||||
|
/// # ButtonPressed,
|
||||||
|
/// # }
|
||||||
|
/// #
|
||||||
/// let mut state = button::State::new();
|
/// let mut state = button::State::new();
|
||||||
/// let disabled_button = Button::new(&mut state, Text::new("I'm disabled!"));
|
/// let disabled_button = Button::<Message>::new(&mut state, Text::new("I'm disabled!"));
|
||||||
/// ```
|
/// ```
|
||||||
#[allow(missing_debug_implementations)]
|
#[allow(missing_debug_implementations)]
|
||||||
pub struct Button<'a, Message, Renderer: self::Renderer> {
|
pub struct Button<'a, Message, Renderer: self::Renderer> {
|
||||||
|
|
|
@ -24,8 +24,14 @@ use dodrio::bumpalo;
|
||||||
/// Buttons can be disabled by not having an on_press.
|
/// Buttons can be disabled by not having an on_press.
|
||||||
///
|
///
|
||||||
/// ```
|
/// ```
|
||||||
|
/// # use iced_web::{button, Button, Text};
|
||||||
|
/// #
|
||||||
|
/// # enum Message {
|
||||||
|
/// # ButtonPressed,
|
||||||
|
/// # }
|
||||||
|
/// #
|
||||||
/// let mut state = button::State::new();
|
/// let mut state = button::State::new();
|
||||||
/// let disabled_button = Button::new(&mut state, Text::new("I'm disabled!"));
|
/// let disabled_button = Button::<Message>::new(&mut state, Text::new("I'm disabled!"));
|
||||||
/// ```
|
/// ```
|
||||||
|
|
||||||
#[allow(missing_debug_implementations)]
|
#[allow(missing_debug_implementations)]
|
||||||
|
|
Loading…
Reference in New Issue