diff --git a/src/lib.rs b/src/lib.rs index ec2f1a5..4f45b8a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -60,6 +60,7 @@ //! ## Arithmetics and math //! Addition and subtraction of two quantities is allowed if the dimensions match: //! ``` +//! # #![feature(generic_const_exprs)] //! # use diman::si::dimensions::{Length}; //! # use diman::si::units::{kilometers, meters}; //! let l = 5.0 * meters + 10.0 * kilometers; @@ -94,6 +95,7 @@ //! ``` //! Exponentiation and related operations are supported via `squared`, `cubed`, `powi`, `sqrt`, `cbrt`: //! ``` +//! # #![feature(generic_const_exprs)] //! # use diman::si::dimensions::{Length}; //! # use diman::si::units::{meters, cubic_meters, square_meters}; //! let length = 2.0f64 * meters; @@ -139,6 +141,7 @@ //! //! Conversion into the underlying storage type can be done using the `value_in` function: //! ``` +//! # #![feature(generic_const_exprs)] //! # use diman::si::units::{kilometers, meters}; //! let length = 2.0f64 * kilometers; //! assert_eq!(format!("{} m", length.value_in(meters)), "2000 m"); @@ -181,6 +184,7 @@ //! ``` //! The combination of `value_unchecked` and `new_unchecked` comes in handy when using third party libraries that only takes the raw storage type as argument. As an example, suppose we have a function `foo` that takes a `Vec` and returns a `Vec`, and suppose it sorts the numbers or does some other unit safe operation. Then we could reasonably write: //! ``` +//! # #![feature(generic_const_exprs)] //! # use diman::si::dimensions::{Length}; //! # use diman::si::units::{meters, kilometers}; //! # fn foo(x: Vec) -> Vec { @@ -312,6 +316,7 @@ //! not needed too many times. Having to add a definition to the unit system for this case can be cumbersome. //! This is why the `Product` and `Quotient` types are provided: //! ``` +//! # #![feature(generic_const_exprs)] //! use diman::si::dimensions::{Length, Time}; //! use diman::{Product, Quotient}; //!