Skip to content

Commit 59a54f4

Browse files
author
James O'Cull
committed
Added some basic documentation for length module
1 parent 7d7f7e9 commit 59a54f4

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/length/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
pub mod consts;
22
mod traits;
3-
43
use self::consts::*;
54

5+
/// The `Length` struct can be used to deal with lengths in a common way.
6+
/// Common metric and imperial units are supported.
67
#[derive(Copy, Clone, Debug)]
78
pub struct Length {
89
meters: f64

src/lib.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
#[cfg(test)]
22
mod tests;
33

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+
415
#[allow(dead_code)]
516
pub mod length;

0 commit comments

Comments
 (0)