Fix failing doctests

This commit is contained in:
Jonas Matser 2020-12-01 14:28:40 +01:00 committed by Héctor Ramón
parent dbc1181011
commit e66120b9c1
2 changed files with 18 additions and 2 deletions

View File

@ -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> {

View File

@ -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)]