File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 1
1
pub mod consts;
2
2
mod traits;
3
-
4
3
use self :: consts:: * ;
5
4
5
+ /// The `Length` struct can be used to deal with lengths in a common way.
6
+ /// Common metric and imperial units are supported.
6
7
#[ derive( Copy , Clone , Debug ) ]
7
8
pub struct Length {
8
9
meters : f64
Original file line number Diff line number Diff line change 1
1
#[ cfg( test) ]
2
2
mod tests;
3
3
4
+ /// The `Length` struct can be used to deal with lengths in a common way.
5
+ /// Common metric and imperial units are supported.
6
+ ///
7
+ /// # Example
8
+ ///
9
+ /// ```
10
+ /// let football_field = Length::from_yards(1.0);
11
+ /// let meters = football_field.as_meters();
12
+ /// println!("There are {} meters in a football field.", meters);
13
+ /// ```
14
+
4
15
#[ allow( dead_code) ]
5
16
pub mod length;
You can’t perform that action at this time.
0 commit comments