doc: enable doc_cfg

This commit is contained in:
MaxOhn
2023-11-09 01:08:14 +01:00
parent 8a643fb6f0
commit e7faacaad1
12 changed files with 23 additions and 5 deletions
+6
View File
@@ -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"]
+2 -1
View File
@@ -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
+1
View File
@@ -47,6 +47,7 @@ use super::{
/// // ...
/// }
/// ```
#[cfg_attr(docsrs, doc(cfg(feature = "gradual")))]
#[derive(Clone, Debug)]
pub struct CatchGradualDifficulty<'map> {
pub(crate) idx: usize,
+1
View File
@@ -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>,
+2
View File
@@ -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
View File
@@ -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))]
+1
View File
@@ -46,6 +46,7 @@ use super::{
/// // ...
/// }
/// ```
#[cfg_attr(docsrs, doc(cfg(feature = "gradual")))]
#[derive(Clone, Debug)]
pub struct ManiaGradualDifficulty<'map> {
pub(crate) idx: usize,
+1
View File
@@ -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>,
+1
View File
@@ -49,6 +49,7 @@ use super::{
/// // ...
/// }
/// ```
#[cfg_attr(docsrs, doc(cfg(feature = "gradual")))]
pub struct OsuGradualDifficulty {
pub(crate) idx: usize,
mods: u32,
+1
View File
@@ -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,
+1
View File
@@ -42,6 +42,7 @@ use super::{
/// // ...
/// }
/// ```
#[cfg_attr(docsrs, doc(cfg(feature = "gradual")))]
#[derive(Debug)]
pub struct TaikoGradualDifficulty {
pub(crate) idx: usize,
+1
View File
@@ -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,