doc: enable doc_cfg
This commit is contained in:
@@ -22,3 +22,9 @@ tokio = { version = "1.2", optional = true, default-features = false, features =
|
||||
|
||||
[dev-dependencies]
|
||||
tokio = { version = "1.2", default-features = false, features = ["fs", "rt"] }
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
# document these features
|
||||
features = ["gradual"]
|
||||
# defines the configuration attribute `docsrs`
|
||||
rustdoc-args = ["--cfg", "docsrs"]
|
||||
@@ -158,10 +158,11 @@ println!("PP after the first 11 objects: {}", curr_performance.pp());
|
||||
### Features
|
||||
|
||||
| Flag | Description |
|
||||
| ------------- | ---------------------------------------------------------------------------------------- |
|
||||
| ------------- |------------------------------------------------------------------------------------------|
|
||||
| `default` | Beatmap parsing will be non-async |
|
||||
| `async_tokio` | Beatmap parsing will be async through [tokio](https://github.com/tokio-rs/tokio) |
|
||||
| `async_std` | Beatmap parsing will be async through [async-std](https://github.com/async-rs/async-std) |
|
||||
| `gradual` | Enable gradual difficulty and performance calculation |
|
||||
|
||||
### Version
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ use super::{
|
||||
/// // ...
|
||||
/// }
|
||||
/// ```
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "gradual")))]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct CatchGradualDifficulty<'map> {
|
||||
pub(crate) idx: usize,
|
||||
|
||||
@@ -92,6 +92,7 @@ use super::{CatchGradualDifficulty, CatchPerformanceAttributes, CatchScoreState}
|
||||
/// // attempting to process further objects will return `None`.
|
||||
/// assert!(gradual_perf.next(state).is_none());
|
||||
/// ```
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "gradual")))]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct CatchGradualPerformance<'map> {
|
||||
difficulty: CatchGradualDifficulty<'map>,
|
||||
|
||||
@@ -37,6 +37,7 @@ use crate::{
|
||||
/// // ...
|
||||
/// }
|
||||
/// ```
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "gradual")))]
|
||||
#[derive(Debug)]
|
||||
pub enum GradualDifficulty<'map> {
|
||||
/// Gradual osu!standard difficulty attributes.
|
||||
@@ -175,6 +176,7 @@ impl Iterator for GradualDifficulty<'_> {
|
||||
/// // attempting to process further objects will return `None`.
|
||||
/// assert!(gradual_perf.next(state).is_none());
|
||||
/// ```
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "gradual")))]
|
||||
#[derive(Debug)]
|
||||
#[allow(clippy::large_enum_variant)]
|
||||
pub enum GradualPerformance<'map> {
|
||||
|
||||
+5
-4
@@ -161,11 +161,12 @@
|
||||
//!
|
||||
//! ## Features
|
||||
//!
|
||||
//! | Flag | Description |
|
||||
//! |-----|-----|
|
||||
//! | `default` | Beatmap parsing will be non-async |
|
||||
//! | Flag | Description |
|
||||
//! |---------------|-----|
|
||||
//! | `default` | Beatmap parsing will be non-async |
|
||||
//! | `async_tokio` | Beatmap parsing will be async through [tokio](https://github.com/tokio-rs/tokio) |
|
||||
//! | `async_std` | Beatmap parsing will be async through [async-std](https://github.com/async-rs/async-std) |
|
||||
//! | `async_std` | Beatmap parsing will be async through [async-std](https://github.com/async-rs/async-std) |
|
||||
//! | `gradual` | Enable gradual difficulty and performance calculation |
|
||||
//!
|
||||
|
||||
#![cfg_attr(docsrs, feature(doc_cfg))]
|
||||
|
||||
@@ -46,6 +46,7 @@ use super::{
|
||||
/// // ...
|
||||
/// }
|
||||
/// ```
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "gradual")))]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct ManiaGradualDifficulty<'map> {
|
||||
pub(crate) idx: usize,
|
||||
|
||||
@@ -75,6 +75,7 @@ use super::{ManiaGradualDifficulty, ManiaPerformanceAttributes, ManiaScoreState}
|
||||
/// // attempting to process further objects will return `None`.
|
||||
/// assert!(gradual_perf.next(state).is_none());
|
||||
/// ```
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "gradual")))]
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct ManiaGradualPerformance<'map> {
|
||||
difficulty: ManiaGradualDifficulty<'map>,
|
||||
|
||||
@@ -49,6 +49,7 @@ use super::{
|
||||
/// // ...
|
||||
/// }
|
||||
/// ```
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "gradual")))]
|
||||
pub struct OsuGradualDifficulty {
|
||||
pub(crate) idx: usize,
|
||||
mods: u32,
|
||||
|
||||
@@ -89,6 +89,7 @@ use super::{OsuGradualDifficulty, OsuPerformanceAttributes, OsuScoreState};
|
||||
/// // attempting to process further objects will return `None`.
|
||||
/// assert!(gradual_perf.next(state).is_none());
|
||||
/// ```
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "gradual")))]
|
||||
#[derive(Debug)]
|
||||
pub struct OsuGradualPerformance<'map> {
|
||||
difficulty: OsuGradualDifficulty,
|
||||
|
||||
@@ -42,6 +42,7 @@ use super::{
|
||||
/// // ...
|
||||
/// }
|
||||
/// ```
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "gradual")))]
|
||||
#[derive(Debug)]
|
||||
pub struct TaikoGradualDifficulty {
|
||||
pub(crate) idx: usize,
|
||||
|
||||
@@ -87,6 +87,7 @@ use super::{TaikoGradualDifficulty, TaikoPerformanceAttributes};
|
||||
/// // attempting to process further objects will return `None`.
|
||||
/// assert!(gradual_perf.next(state).is_none());
|
||||
/// ```
|
||||
#[cfg_attr(docsrs, doc(cfg(feature = "gradual")))]
|
||||
#[derive(Debug)]
|
||||
pub struct TaikoGradualPerformance<'map> {
|
||||
difficulty: TaikoGradualDifficulty,
|
||||
|
||||
Reference in New Issue
Block a user