Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reference feature flags in docs #259

Merged
merged 4 commits into from
Apr 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,7 @@ iced_wgpu = { version = "0.2", path = "wgpu" }

[target.'cfg(target_arch = "wasm32")'.dependencies]
iced_web = { version = "0.2", path = "web" }

[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"]
features = ["image", "svg", "canvas"]
4 changes: 4 additions & 0 deletions futures/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@ optional = true

[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen-futures = "0.4"

[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"]
all-features = true
1 change: 1 addition & 0 deletions futures/src/executor/async_std.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use crate::Executor;
use futures::Future;

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

Expand Down
1 change: 1 addition & 0 deletions futures/src/executor/thread_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use crate::Executor;
use futures::Future;

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

impl Executor for futures::executor::ThreadPool {
Expand Down
1 change: 1 addition & 0 deletions futures/src/executor/tokio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use crate::Executor;
use futures::Future;

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

impl Executor for Tokio {
Expand Down
2 changes: 2 additions & 0 deletions futures/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#![deny(unused_results)]
#![forbid(unsafe_code)]
#![forbid(rust_2018_idioms)]
#![cfg_attr(docsrs, feature(doc_cfg))]

pub use futures;

mod command;
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@
#![deny(unused_results)]
#![forbid(unsafe_code)]
#![forbid(rust_2018_idioms)]
#![cfg_attr(docsrs, feature(doc_cfg))]
mod application;
mod element;
mod sandbox;
Expand Down
11 changes: 10 additions & 1 deletion src/widget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,22 @@
//! [`text_input::State`]: text_input/struct.State.html
#[cfg(not(target_arch = "wasm32"))]
mod platform {
pub use iced_wgpu::widget::*;
pub use iced_wgpu::widget::{
button, checkbox, container, pane_grid, progress_bar, radio,
scrollable, slider, text_input,
};

#[cfg(feature = "canvas")]
#[cfg_attr(docsrs, doc(cfg(feature = "canvas")))]
pub use iced_wgpu::widget::canvas;

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

#[cfg_attr(docsrs, doc(cfg(feature = "svg")))]
pub mod svg {
//! Display vector graphics in your user interface.
pub use iced_winit::svg::{Handle, Svg};
Expand Down
4 changes: 4 additions & 0 deletions wgpu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,7 @@ optional = true
[dependencies.lyon]
version = "0.15"
optional = true

[package.metadata.docs.rs]
rustdoc-args = ["--cfg", "docsrs"]
all-features = true
2 changes: 2 additions & 0 deletions wgpu/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#![deny(unused_results)]
#![forbid(unsafe_code)]
#![forbid(rust_2018_idioms)]
#![cfg_attr(docsrs, feature(doc_cfg))]

pub mod defaults;
pub mod settings;
pub mod triangle;
Expand Down
1 change: 1 addition & 0 deletions wgpu/src/widget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ pub use slider::Slider;
pub use text_input::TextInput;

#[cfg(feature = "canvas")]
#[cfg_attr(docsrs, doc(cfg(feature = "canvas")))]
pub mod canvas;

#[cfg(feature = "canvas")]
Expand Down
1 change: 1 addition & 0 deletions wgpu/src/widget/canvas/frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ impl Frame {
///
/// [`Text`]: struct.Text.html
/// [`Frame`]: struct.Frame.html
/// [`Canvas`]: struct.Canvas.html
pub fn fill_text(&mut self, text: Text) {
use std::f32;

Expand Down