prunus/lib.rs
1//! # prunus
2//!
3//! prunus is a genus of trees and shrubs, which includes (among many others)
4//! the fruits plums, cherries, peaches, nectarines, apricots, and almonds.
5
6pub use cherry::Tree;
7
8/// Turn the peaches into plums using the formula:
9/// plum = (peach * 3 - 4) * 2
10///
11/// # Examples
12///
13/// ```
14/// let a = 6;
15/// let result = prunus::turn_peach_into_plum(a);
16///
17/// assert_eq!(result, 28);
18/// ```
19pub fn turn_peach_into_plum(peach: i32) -> i32 {
20 (peach * 3 - 4) * 2
21}
22
23
24pub mod cherry {
25 pub struct Tree {
26 pub height: f32,
27 pub age: i32,
28 pub blossom_color: (i32, i32, i32),
29 }
30}
31