Annotate root crate tests with standalone_crate
The new Rustdoc combined tests are an order of magnitude slower in my machine for the `iced` root crate.
This commit is contained in:
parent
53ce0e3a88
commit
33d20763c8
2 changed files with 18 additions and 18 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
//! Create and run iced applications step by step.
|
//! Create and run iced applications step by step.
|
||||||
//!
|
//!
|
||||||
//! # Example
|
//! # Example
|
||||||
//! ```no_run
|
//! ```no_run,standalone_crate
|
||||||
//! use iced::widget::{button, column, text, Column};
|
//! use iced::widget::{button, column, text, Column};
|
||||||
//! use iced::Theme;
|
//! use iced::Theme;
|
||||||
//!
|
//!
|
||||||
|
|
@ -42,7 +42,7 @@ use std::borrow::Cow;
|
||||||
/// Creates an iced [`Application`] given its title, update, and view logic.
|
/// Creates an iced [`Application`] given its title, update, and view logic.
|
||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
/// ```no_run
|
/// ```no_run,standalone_crate
|
||||||
/// use iced::widget::{button, column, text, Column};
|
/// use iced::widget::{button, column, text, Column};
|
||||||
///
|
///
|
||||||
/// pub fn main() -> iced::Result {
|
/// pub fn main() -> iced::Result {
|
||||||
|
|
|
||||||
32
src/lib.rs
32
src/lib.rs
|
|
@ -29,7 +29,7 @@
|
||||||
//! # The Pocket Guide
|
//! # The Pocket Guide
|
||||||
//! Start by calling [`run`]:
|
//! Start by calling [`run`]:
|
||||||
//!
|
//!
|
||||||
//! ```rust,no_run
|
//! ```no_run,standalone_crate
|
||||||
//! pub fn main() -> iced::Result {
|
//! pub fn main() -> iced::Result {
|
||||||
//! iced::run("A cool counter", update, view)
|
//! iced::run("A cool counter", update, view)
|
||||||
//! }
|
//! }
|
||||||
|
|
@ -39,7 +39,7 @@
|
||||||
//!
|
//!
|
||||||
//! Define an `update` function to __change__ your state:
|
//! Define an `update` function to __change__ your state:
|
||||||
//!
|
//!
|
||||||
//! ```rust
|
//! ```standalone_crate
|
||||||
//! fn update(counter: &mut u64, message: Message) {
|
//! fn update(counter: &mut u64, message: Message) {
|
||||||
//! match message {
|
//! match message {
|
||||||
//! Message::Increment => *counter += 1,
|
//! Message::Increment => *counter += 1,
|
||||||
|
|
@ -51,7 +51,7 @@
|
||||||
//!
|
//!
|
||||||
//! Define a `view` function to __display__ your state:
|
//! Define a `view` function to __display__ your state:
|
||||||
//!
|
//!
|
||||||
//! ```rust
|
//! ```standalone_crate
|
||||||
//! use iced::widget::{button, text};
|
//! use iced::widget::{button, text};
|
||||||
//! use iced::Element;
|
//! use iced::Element;
|
||||||
//!
|
//!
|
||||||
|
|
@ -64,7 +64,7 @@
|
||||||
//!
|
//!
|
||||||
//! And create a `Message` enum to __connect__ `view` and `update` together:
|
//! And create a `Message` enum to __connect__ `view` and `update` together:
|
||||||
//!
|
//!
|
||||||
//! ```rust
|
//! ```standalone_crate
|
||||||
//! #[derive(Debug, Clone)]
|
//! #[derive(Debug, Clone)]
|
||||||
//! enum Message {
|
//! enum Message {
|
||||||
//! Increment,
|
//! Increment,
|
||||||
|
|
@ -74,7 +74,7 @@
|
||||||
//! ## Custom State
|
//! ## Custom State
|
||||||
//! You can define your own struct for your state:
|
//! You can define your own struct for your state:
|
||||||
//!
|
//!
|
||||||
//! ```rust
|
//! ```standalone_crate
|
||||||
//! #[derive(Default)]
|
//! #[derive(Default)]
|
||||||
//! struct Counter {
|
//! struct Counter {
|
||||||
//! value: u64,
|
//! value: u64,
|
||||||
|
|
@ -83,7 +83,7 @@
|
||||||
//!
|
//!
|
||||||
//! But you have to change `update` and `view` accordingly:
|
//! But you have to change `update` and `view` accordingly:
|
||||||
//!
|
//!
|
||||||
//! ```rust
|
//! ```standalone_crate
|
||||||
//! # struct Counter { value: u64 }
|
//! # struct Counter { value: u64 }
|
||||||
//! # #[derive(Clone)]
|
//! # #[derive(Clone)]
|
||||||
//! # enum Message { Increment }
|
//! # enum Message { Increment }
|
||||||
|
|
@ -108,7 +108,7 @@
|
||||||
//!
|
//!
|
||||||
//! Widgets are configured using the builder pattern:
|
//! Widgets are configured using the builder pattern:
|
||||||
//!
|
//!
|
||||||
//! ```rust
|
//! ```standalone_crate
|
||||||
//! # struct Counter { value: u64 }
|
//! # struct Counter { value: u64 }
|
||||||
//! # #[derive(Clone)]
|
//! # #[derive(Clone)]
|
||||||
//! # enum Message { Increment }
|
//! # enum Message { Increment }
|
||||||
|
|
@ -138,7 +138,7 @@
|
||||||
//! Building your layout will often consist in using a combination of
|
//! Building your layout will often consist in using a combination of
|
||||||
//! [rows], [columns], and [containers]:
|
//! [rows], [columns], and [containers]:
|
||||||
//!
|
//!
|
||||||
//! ```rust
|
//! ```standalone_crate
|
||||||
//! # struct State;
|
//! # struct State;
|
||||||
//! # enum Message {}
|
//! # enum Message {}
|
||||||
//! use iced::widget::{column, container, row};
|
//! use iced::widget::{column, container, row};
|
||||||
|
|
@ -181,7 +181,7 @@
|
||||||
//!
|
//!
|
||||||
//! A fixed numeric [`Length`] in [`Pixels`] can also be used:
|
//! A fixed numeric [`Length`] in [`Pixels`] can also be used:
|
||||||
//!
|
//!
|
||||||
//! ```rust
|
//! ```standalone_crate
|
||||||
//! # struct State;
|
//! # struct State;
|
||||||
//! # enum Message {}
|
//! # enum Message {}
|
||||||
//! use iced::widget::container;
|
//! use iced::widget::container;
|
||||||
|
|
@ -197,7 +197,7 @@
|
||||||
//! function and leveraging the [`Application`] builder, instead of directly
|
//! function and leveraging the [`Application`] builder, instead of directly
|
||||||
//! calling [`run`]:
|
//! calling [`run`]:
|
||||||
//!
|
//!
|
||||||
//! ```rust,no_run
|
//! ```no_run,standalone_crate
|
||||||
//! # #[derive(Default)]
|
//! # #[derive(Default)]
|
||||||
//! # struct State;
|
//! # struct State;
|
||||||
//! use iced::Theme;
|
//! use iced::Theme;
|
||||||
|
|
@ -227,7 +227,7 @@
|
||||||
//!
|
//!
|
||||||
//! The appearance of a widget can be changed by calling its `style` method:
|
//! The appearance of a widget can be changed by calling its `style` method:
|
||||||
//!
|
//!
|
||||||
//! ```rust
|
//! ```standalone_crate
|
||||||
//! # struct State;
|
//! # struct State;
|
||||||
//! # enum Message {}
|
//! # enum Message {}
|
||||||
//! use iced::widget::container;
|
//! use iced::widget::container;
|
||||||
|
|
@ -241,7 +241,7 @@
|
||||||
//! The `style` method of a widget takes a closure that, given the current active
|
//! The `style` method of a widget takes a closure that, given the current active
|
||||||
//! [`Theme`], returns the widget style:
|
//! [`Theme`], returns the widget style:
|
||||||
//!
|
//!
|
||||||
//! ```rust
|
//! ```standalone_crate
|
||||||
//! # struct State;
|
//! # struct State;
|
||||||
//! # #[derive(Clone)]
|
//! # #[derive(Clone)]
|
||||||
//! # enum Message {}
|
//! # enum Message {}
|
||||||
|
|
@ -286,7 +286,7 @@
|
||||||
//! A [`Task`] can be leveraged to perform asynchronous work, like running a
|
//! A [`Task`] can be leveraged to perform asynchronous work, like running a
|
||||||
//! future or a stream:
|
//! future or a stream:
|
||||||
//!
|
//!
|
||||||
//! ```rust
|
//! ```standalone_crate
|
||||||
//! # #[derive(Clone)]
|
//! # #[derive(Clone)]
|
||||||
//! # struct Weather;
|
//! # struct Weather;
|
||||||
//! use iced::Task;
|
//! use iced::Task;
|
||||||
|
|
@ -334,7 +334,7 @@
|
||||||
//!
|
//!
|
||||||
//! You will need to define a `subscription` function and use the [`Application`] builder:
|
//! You will need to define a `subscription` function and use the [`Application`] builder:
|
||||||
//!
|
//!
|
||||||
//! ```rust,no_run
|
//! ```no_run,standalone_crate
|
||||||
//! # #[derive(Default)]
|
//! # #[derive(Default)]
|
||||||
//! # struct State;
|
//! # struct State;
|
||||||
//! use iced::window;
|
//! use iced::window;
|
||||||
|
|
@ -375,7 +375,7 @@
|
||||||
//! A common pattern is to leverage this composability to split an
|
//! A common pattern is to leverage this composability to split an
|
||||||
//! application into different screens:
|
//! application into different screens:
|
||||||
//!
|
//!
|
||||||
//! ```rust
|
//! ```standalone_crate
|
||||||
//! # mod contacts {
|
//! # mod contacts {
|
||||||
//! # use iced::{Element, Task};
|
//! # use iced::{Element, Task};
|
||||||
//! # pub struct Contacts;
|
//! # pub struct Contacts;
|
||||||
|
|
@ -656,7 +656,7 @@ pub type Result = std::result::Result<(), Error>;
|
||||||
/// This is equivalent to chaining [`application()`] with [`Application::run`].
|
/// This is equivalent to chaining [`application()`] with [`Application::run`].
|
||||||
///
|
///
|
||||||
/// # Example
|
/// # Example
|
||||||
/// ```no_run
|
/// ```no_run,standalone_crate
|
||||||
/// use iced::widget::{button, column, text, Column};
|
/// use iced::widget::{button, column, text, Column};
|
||||||
///
|
///
|
||||||
/// pub fn main() -> iced::Result {
|
/// pub fn main() -> iced::Result {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue