Skip to content

Commit ad0a6c4

Browse files
authored
Merge pull request #259 from robjtede/docs/feature-flags
reference feature flags in docs
2 parents fd064ff + 335ad1d commit ad0a6c4

12 files changed

Lines changed: 32 additions & 1 deletion

File tree

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,7 @@ iced_wgpu = { version = "0.2", path = "wgpu" }
6565

6666
[target.'cfg(target_arch = "wasm32")'.dependencies]
6767
iced_web = { version = "0.2", path = "web" }
68+
69+
[package.metadata.docs.rs]
70+
rustdoc-args = ["--cfg", "docsrs"]
71+
features = ["image", "svg", "canvas"]

futures/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,7 @@ optional = true
3030

3131
[target.'cfg(target_arch = "wasm32")'.dependencies]
3232
wasm-bindgen-futures = "0.4"
33+
34+
[package.metadata.docs.rs]
35+
rustdoc-args = ["--cfg", "docsrs"]
36+
all-features = true

futures/src/executor/async_std.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use crate::Executor;
33
use futures::Future;
44

55
/// An `async-std` runtime.
6+
#[cfg_attr(docsrs, doc(cfg(feature = "async-std")))]
67
#[derive(Debug)]
78
pub struct AsyncStd;
89

futures/src/executor/thread_pool.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use crate::Executor;
33
use futures::Future;
44

55
/// A thread pool runtime for futures.
6+
#[cfg_attr(docsrs, doc(cfg(feature = "thread-pool")))]
67
pub type ThreadPool = futures::executor::ThreadPool;
78

89
impl Executor for futures::executor::ThreadPool {

futures/src/executor/tokio.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use crate::Executor;
33
use futures::Future;
44

55
/// A `tokio` runtime.
6+
#[cfg_attr(docsrs, doc(cfg(feature = "tokio")))]
67
pub type Tokio = tokio::runtime::Runtime;
78

89
impl Executor for Tokio {

futures/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#![deny(unused_results)]
55
#![forbid(unsafe_code)]
66
#![forbid(rust_2018_idioms)]
7+
#![cfg_attr(docsrs, feature(doc_cfg))]
8+
79
pub use futures;
810

911
mod command;

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@
178178
#![deny(unused_results)]
179179
#![forbid(unsafe_code)]
180180
#![forbid(rust_2018_idioms)]
181+
#![cfg_attr(docsrs, feature(doc_cfg))]
181182
mod application;
182183
mod element;
183184
mod sandbox;

src/widget.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,22 @@
1818
//! [`text_input::State`]: text_input/struct.State.html
1919
#[cfg(not(target_arch = "wasm32"))]
2020
mod platform {
21-
pub use iced_wgpu::widget::*;
21+
pub use iced_wgpu::widget::{
22+
button, checkbox, container, pane_grid, progress_bar, radio,
23+
scrollable, slider, text_input,
24+
};
25+
26+
#[cfg(feature = "canvas")]
27+
#[cfg_attr(docsrs, doc(cfg(feature = "canvas")))]
28+
pub use iced_wgpu::widget::canvas;
2229

30+
#[cfg_attr(docsrs, doc(cfg(feature = "image")))]
2331
pub mod image {
2432
//! Display images in your user interface.
2533
pub use iced_winit::image::{Handle, Image};
2634
}
2735

36+
#[cfg_attr(docsrs, doc(cfg(feature = "svg")))]
2837
pub mod svg {
2938
//! Display vector graphics in your user interface.
3039
pub use iced_winit::svg::{Handle, Svg};

wgpu/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,7 @@ optional = true
4141
[dependencies.lyon]
4242
version = "0.15"
4343
optional = true
44+
45+
[package.metadata.docs.rs]
46+
rustdoc-args = ["--cfg", "docsrs"]
47+
all-features = true

wgpu/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
#![deny(unused_results)]
2626
#![forbid(unsafe_code)]
2727
#![forbid(rust_2018_idioms)]
28+
#![cfg_attr(docsrs, feature(doc_cfg))]
29+
2830
pub mod defaults;
2931
pub mod settings;
3032
pub mod triangle;

0 commit comments

Comments
 (0)