Enable doc_auto_cfg when generating documentation
This commit is contained in:
parent
3220d472ac
commit
cf434236e7
12 changed files with 7 additions and 19 deletions
|
|
@ -1,16 +1,12 @@
|
||||||
//! Backends that are only available in native platforms: Windows, macOS, or Linux.
|
//! Backends that are only available in native platforms: Windows, macOS, or Linux.
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "tokio",)))]
|
|
||||||
#[cfg(feature = "tokio")]
|
#[cfg(feature = "tokio")]
|
||||||
pub mod tokio;
|
pub mod tokio;
|
||||||
|
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "async-std",)))]
|
|
||||||
#[cfg(feature = "async-std")]
|
#[cfg(feature = "async-std")]
|
||||||
pub mod async_std;
|
pub mod async_std;
|
||||||
|
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "smol",)))]
|
|
||||||
#[cfg(feature = "smol")]
|
#[cfg(feature = "smol")]
|
||||||
pub mod smol;
|
pub mod smol;
|
||||||
|
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "thread-pool",)))]
|
|
||||||
#[cfg(feature = "thread-pool")]
|
#[cfg(feature = "thread-pool")]
|
||||||
pub mod thread_pool;
|
pub mod thread_pool;
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
//! A `smol` backend.
|
//! A `smol` backend.
|
||||||
|
|
||||||
use futures::Future;
|
use futures::Future;
|
||||||
|
|
||||||
/// A `smol` executor.
|
/// A `smol` executor.
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "smol")))]
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Executor;
|
pub struct Executor;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
use futures::Future;
|
use futures::Future;
|
||||||
|
|
||||||
/// A thread pool executor for futures.
|
/// A thread pool executor for futures.
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "thread-pool")))]
|
|
||||||
pub type Executor = futures::executor::ThreadPool;
|
pub type Executor = futures::executor::ThreadPool;
|
||||||
|
|
||||||
impl crate::Executor for Executor {
|
impl crate::Executor for Executor {
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
)]
|
)]
|
||||||
#![forbid(unsafe_code, rust_2018_idioms)]
|
#![forbid(unsafe_code, rust_2018_idioms)]
|
||||||
#![allow(clippy::inherent_to_string, clippy::type_complexity)]
|
#![allow(clippy::inherent_to_string, clippy::type_complexity)]
|
||||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
||||||
pub use futures;
|
pub use futures;
|
||||||
pub use iced_core as core;
|
pub use iced_core as core;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@
|
||||||
)]
|
)]
|
||||||
#![forbid(rust_2018_idioms)]
|
#![forbid(rust_2018_idioms)]
|
||||||
#![allow(clippy::inherent_to_string, clippy::type_complexity)]
|
#![allow(clippy::inherent_to_string, clippy::type_complexity)]
|
||||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
||||||
mod antialiasing;
|
mod antialiasing;
|
||||||
mod error;
|
mod error;
|
||||||
mod transformation;
|
mod transformation;
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@
|
||||||
clippy::useless_conversion
|
clippy::useless_conversion
|
||||||
)]
|
)]
|
||||||
#![forbid(unsafe_code, rust_2018_idioms)]
|
#![forbid(unsafe_code, rust_2018_idioms)]
|
||||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
||||||
pub mod clipboard;
|
pub mod clipboard;
|
||||||
pub mod command;
|
pub mod command;
|
||||||
pub mod font;
|
pub mod font;
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,7 @@
|
||||||
)]
|
)]
|
||||||
#![forbid(rust_2018_idioms, unsafe_code)]
|
#![forbid(rust_2018_idioms, unsafe_code)]
|
||||||
#![allow(clippy::inherent_to_string, clippy::type_complexity)]
|
#![allow(clippy::inherent_to_string, clippy::type_complexity)]
|
||||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
||||||
use iced_widget::graphics;
|
use iced_widget::graphics;
|
||||||
use iced_widget::renderer;
|
use iced_widget::renderer;
|
||||||
use iced_widget::style;
|
use iced_widget::style;
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@ use std::path::Path;
|
||||||
///
|
///
|
||||||
/// This will return an error in case the file is missing at run-time. You may prefer [`Self::from_file_data`] instead.
|
/// This will return an error in case the file is missing at run-time. You may prefer [`Self::from_file_data`] instead.
|
||||||
#[cfg(feature = "image")]
|
#[cfg(feature = "image")]
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "image")))]
|
|
||||||
pub fn from_file<P: AsRef<Path>>(icon_path: P) -> Result<Icon, Error> {
|
pub fn from_file<P: AsRef<Path>>(icon_path: P) -> Result<Icon, Error> {
|
||||||
let icon = image_rs::io::Reader::open(icon_path)?.decode()?.to_rgba8();
|
let icon = image_rs::io::Reader::open(icon_path)?.decode()?.to_rgba8();
|
||||||
|
|
||||||
|
|
@ -24,7 +23,6 @@ pub fn from_file<P: AsRef<Path>>(icon_path: P) -> Result<Icon, Error> {
|
||||||
/// This content can be included in your application at compile-time, e.g. using the `include_bytes!` macro.
|
/// This content can be included in your application at compile-time, e.g. using the `include_bytes!` macro.
|
||||||
/// You can pass an explicit file format. Otherwise, the file format will be guessed at runtime.
|
/// You can pass an explicit file format. Otherwise, the file format will be guessed at runtime.
|
||||||
#[cfg(feature = "image")]
|
#[cfg(feature = "image")]
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "image")))]
|
|
||||||
pub fn from_file_data(
|
pub fn from_file_data(
|
||||||
data: &[u8],
|
data: &[u8],
|
||||||
explicit_format: Option<image_rs::ImageFormat>,
|
explicit_format: Option<image_rs::ImageFormat>,
|
||||||
|
|
@ -60,7 +58,6 @@ pub enum Error {
|
||||||
|
|
||||||
/// The `image` crate reported an error.
|
/// The `image` crate reported an error.
|
||||||
#[cfg(feature = "image")]
|
#[cfg(feature = "image")]
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "image")))]
|
|
||||||
#[error("Unable to create icon from a file: {0}")]
|
#[error("Unable to create icon from a file: {0}")]
|
||||||
ImageError(#[from] image_rs::error::ImageError),
|
ImageError(#[from] image_rs::error::ImageError),
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@
|
||||||
)]
|
)]
|
||||||
#![forbid(rust_2018_idioms)]
|
#![forbid(rust_2018_idioms)]
|
||||||
#![allow(clippy::inherent_to_string, clippy::type_complexity)]
|
#![allow(clippy::inherent_to_string, clippy::type_complexity)]
|
||||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
||||||
pub mod layer;
|
pub mod layer;
|
||||||
pub mod settings;
|
pub mod settings;
|
||||||
pub mod window;
|
pub mod window;
|
||||||
|
|
|
||||||
|
|
@ -310,7 +310,6 @@ where
|
||||||
///
|
///
|
||||||
/// [`Image`]: widget::Image
|
/// [`Image`]: widget::Image
|
||||||
#[cfg(feature = "image")]
|
#[cfg(feature = "image")]
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "image")))]
|
|
||||||
pub fn image<Handle>(handle: impl Into<Handle>) -> crate::Image<Handle> {
|
pub fn image<Handle>(handle: impl Into<Handle>) -> crate::Image<Handle> {
|
||||||
crate::Image::new(handle.into())
|
crate::Image::new(handle.into())
|
||||||
}
|
}
|
||||||
|
|
@ -320,7 +319,6 @@ pub fn image<Handle>(handle: impl Into<Handle>) -> crate::Image<Handle> {
|
||||||
/// [`Svg`]: widget::Svg
|
/// [`Svg`]: widget::Svg
|
||||||
/// [`Handle`]: widget::svg::Handle
|
/// [`Handle`]: widget::svg::Handle
|
||||||
#[cfg(feature = "svg")]
|
#[cfg(feature = "svg")]
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "svg")))]
|
|
||||||
pub fn svg<Renderer>(
|
pub fn svg<Renderer>(
|
||||||
handle: impl Into<core::svg::Handle>,
|
handle: impl Into<core::svg::Handle>,
|
||||||
) -> crate::Svg<Renderer>
|
) -> crate::Svg<Renderer>
|
||||||
|
|
@ -333,7 +331,6 @@ where
|
||||||
|
|
||||||
/// Creates a new [`Canvas`].
|
/// Creates a new [`Canvas`].
|
||||||
#[cfg(feature = "canvas")]
|
#[cfg(feature = "canvas")]
|
||||||
#[cfg_attr(docsrs, doc(cfg(feature = "canvas")))]
|
|
||||||
pub fn canvas<P, Message, Renderer>(
|
pub fn canvas<P, Message, Renderer>(
|
||||||
program: P,
|
program: P,
|
||||||
) -> crate::Canvas<P, Message, Renderer>
|
) -> crate::Canvas<P, Message, Renderer>
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@
|
||||||
)]
|
)]
|
||||||
#![forbid(unsafe_code, rust_2018_idioms)]
|
#![forbid(unsafe_code, rust_2018_idioms)]
|
||||||
#![allow(clippy::inherent_to_string, clippy::type_complexity)]
|
#![allow(clippy::inherent_to_string, clippy::type_complexity)]
|
||||||
|
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
||||||
pub use iced_renderer as renderer;
|
pub use iced_renderer as renderer;
|
||||||
pub use iced_renderer::graphics;
|
pub use iced_renderer::graphics;
|
||||||
pub use iced_runtime as runtime;
|
pub use iced_runtime as runtime;
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
)]
|
)]
|
||||||
#![forbid(rust_2018_idioms, unsafe_code)]
|
#![forbid(rust_2018_idioms, unsafe_code)]
|
||||||
#![allow(clippy::inherent_to_string, clippy::type_complexity)]
|
#![allow(clippy::inherent_to_string, clippy::type_complexity)]
|
||||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
|
||||||
pub use iced_graphics as graphics;
|
pub use iced_graphics as graphics;
|
||||||
pub use iced_runtime as runtime;
|
pub use iced_runtime as runtime;
|
||||||
pub use iced_runtime::core;
|
pub use iced_runtime::core;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue