Skip to content

Commit 6c18ec0

Browse files
authored
refactor(docs): enable missing_docs and broken_intra_doc_links denials (#343) (#380)
* refactor(docs): enable #![deny(missing_docs, rustdoc::broken_intra_doc_links)] (#343) * docs: add missing docs to unlock deny(missing_docs) (#343) - `utils::time::units_per_year`: explain the annualisation helper. - `visualization::plotly::Graph`: describe the trait contract and the default impl split across the `plotly` / `static_export` features. - `model::decimal::tests`: one-line description for the pub test module so `missing_docs` accepts the doctest-wired visibility. - `volatility::utils`: fix broken intra-doc link `DecimalError::Overflow` → `crate::error::DecimalError::Overflow`. Unblocks PR #380 under `#![deny(missing_docs, rustdoc::broken_intra_doc_links)]`.
1 parent d57ed6c commit 6c18ec0

5 files changed

Lines changed: 13 additions & 1 deletion

File tree

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#![allow(unknown_lints)]
22
#![allow(clippy::literal_string_with_formatting_args)]
3+
#![deny(missing_docs, rustdoc::broken_intra_doc_links)]
34
// Per rules/global_rules.md §Error Handling, unchecked `[]` / slicing is
45
// banned in production code. Enforced crate-wide; individual modules that
56
// need a transitional escape hatch carry a scoped `#![allow(..)]` with a

src/model/decimal.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,7 @@ macro_rules! f2d {
524524
};
525525
}
526526

527+
/// Conversion helpers' sanity tests (public module to support doctest wiring).
527528
#[cfg(test)]
528529
pub mod tests {
529530
use super::*;

src/utils/time.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ fn pos_lit(d: rust_decimal::Decimal) -> Positive {
157157
Positive::new_decimal(d).unwrap_or(Positive::ZERO)
158158
}
159159

160+
/// Returns how many units of the given `TimeFrame` fit into a calendar year
161+
/// as a `Positive`. Used by annualisation helpers (volatility, yield
162+
/// curves) to scale per-period values to a standardised annual basis.
160163
#[must_use]
161164
pub fn units_per_year(time_frame: &TimeFrame) -> Positive {
162165
match time_frame {

src/visualization/plotly.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ use plotly::plotly_static::ImageFormat;
1414
#[cfg(feature = "static_export")]
1515
use tracing::debug;
1616

17+
/// Trait implemented by every strategy / chain / surface that can
18+
/// render itself as a Plotly figure.
19+
///
20+
/// Provides the data-only `graph_data()` / `graph_config()` hooks plus
21+
/// the feature-gated `to_plot` / `write_html` / `write_png` renderers.
22+
/// Implementers need only supply `graph_data`; the rest have safe
23+
/// defaults under the `plotly` (and `static_export`) features.
1724
pub trait Graph {
1825
/// Return the raw data ready for plotting.
1926
fn graph_data(&self) -> GraphData;

src/volatility/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ pub fn calculate_iv(
332332
///
333333
/// # Errors
334334
///
335-
/// - Propagates [`DecimalError::Overflow`] from the underlying
335+
/// - Propagates [`crate::error::DecimalError::Overflow`] from the underlying
336336
/// checked arithmetic helpers (`d_mul`, `d_add`) wrapped as
337337
/// [`VolatilityError::DecimalError`] via the `#[from]` cascade.
338338
/// This happens when any of the four monetary products

0 commit comments

Comments
 (0)