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

Match lib.rs doc comments to README.md. #5

Merged
merged 1 commit into from
Mar 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
//! # Roundable values
//! # Round numbers and durations to a given factor
//!
//! This provides an implementation of rounding for various values, including
//! [`core::time::Duration`] (or `std::time::Duration`).
//! the the native number types and [`core::time::Duration`] (or
//! `std::time::Duration`).
//!
//! This crate is does not need `std` or `alloc` (it’s always in `no_std` mode).
//! No features need to be enabled or disabled.
//!
//! ```rust
//! use roundable::Roundable;
//!
//! assert!(310 == 314.round_to(10));
//! assert!(300.0 == 314.1.round_to(100.0));
//!
//! // To avoid panicking on overflow:
//! assert!(Some(260) == 255.try_round_to(10));
//! assert!(None == 255u8.try_round_to(10));
//! ```
//!
//! See [Constants](#constants) for a list of time units that make rounding
//! [`Duration`] easier.
//! See [the list of constants][#constants] for a list of time units that make
//! rounding [`Duration`] easier.
//!
//! ```rust
//! use roundable::{SECOND, MINUTE, Roundable};
Expand Down