Skip to content

Commit a9fe1eb

Browse files
committed
docs: chage **use** in doc
1 parent 91bde2d commit a9fe1eb

5 files changed

Lines changed: 41 additions & 17 deletions

File tree

src/function/function.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ use std::sync::Arc;
1313
/// # Examples
1414
///
1515
/// ```
16+
/// use mathrc::Func;
17+
///
1618
/// let f = Func::new(|x: f64| x * x);
1719
///
1820
/// assert_eq!(f.call(3.0), 9.0);
@@ -28,6 +30,8 @@ impl<T: Float + 'static> Func<T> {
2830
/// # Examples
2931
///
3032
/// ```
33+
/// use mathrc::Func;
34+
///
3135
/// let f = Func::new(|x: f64| x + 1.0);
3236
///
3337
/// assert_eq!(f.call(2.0), 3.0);

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@ pub use num::Frac;
2626
pub use num::Matrix;
2727

2828
pub use function::Func;
29+
30+
pub use math::Math;

src/num/frac.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ use std::fmt;
1010
/// # Examples
1111
///
1212
/// ```
13+
/// use mathrc::Frac;
14+
///
1315
/// let frac = Frac::new(1, 2).unwrap();
1416
///
1517
/// assert_eq!(frac.num, 1);
@@ -45,6 +47,8 @@ impl Frac {
4547
/// # Examples
4648
///
4749
/// ```
50+
/// use mathrc::Frac;
51+
///
4852
/// let frac = Frac::new(2, 4).unwrap();
4953
/// ```
5054
pub fn new(num: i64, den: i64) -> Result<Self, String> {
@@ -59,6 +63,8 @@ impl Frac {
5963
/// # Examples
6064
///
6165
/// ```
66+
/// use mathrc::Frac;
67+
///
6268
/// let frac = Frac::new(1, 2).unwrap();
6369
///
6470
/// assert_eq!(frac.to_dec(), 0.5);
@@ -74,6 +80,8 @@ impl Frac {
7480
/// # Examples
7581
///
7682
/// ```
83+
/// use mathrc::Frac;
84+
///
7785
/// let frac = Frac::new(2, 4).unwrap();
7886
///
7987
/// assert_eq!(frac.normalize().to_string(), "1/2");
@@ -105,6 +113,8 @@ impl Frac {
105113
/// # Examples
106114
///
107115
/// ```
116+
/// use mathrc::Frac;
117+
///
108118
/// let frac = Frac::new(2, 3).unwrap();
109119
///
110120
/// assert_eq!(frac.reverse().unwrap().to_string(), "3/2");
@@ -125,6 +135,8 @@ impl Frac {
125135
/// # Examples
126136
///
127137
/// ```
138+
/// use mathrc::Frac;
139+
///
128140
/// let a = Frac::new(1, 2).unwrap();
129141
/// let b = Frac::new(1, 3).unwrap();
130142
///
@@ -142,6 +154,8 @@ impl Frac {
142154
/// # Examples
143155
///
144156
/// ```
157+
/// use mathrc::Frac;
158+
///
145159
/// let a = Frac::new(3, 4).unwrap();
146160
/// let b = Frac::new(1, 4).unwrap();
147161
///
@@ -159,6 +173,8 @@ impl Frac {
159173
/// # Examples
160174
///
161175
/// ```
176+
/// use mathrc::Frac;
177+
///
162178
/// let a = Frac::new(2, 3).unwrap();
163179
/// let b = Frac::new(3, 4).unwrap();
164180
///
@@ -176,6 +192,8 @@ impl Frac {
176192
/// # Examples
177193
///
178194
/// ```
195+
/// use mathrc::Frac;
196+
///
179197
/// let a = Frac::new(1, 2).unwrap();
180198
/// let b = Frac::new(1, 4).unwrap();
181199
///

src/vector/vector2d.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//! # Examples
88
//!
99
//! ```rust
10-
//! use mathrc::vector::Vector2d;
10+
//! use mathrc::Vector2d;
1111
//!
1212
//! let a = Vector2d::new(1.0, 2.0);
1313
//! let b = Vector2d::new(3.0, 4.0);
@@ -17,7 +17,7 @@
1717
//! ```
1818
//!
1919
//! ```rust
20-
//! use mathrc::vector::{Vector2d, VectorOps};
20+
//! use mathrc::{Vector2d, VectorOps};
2121
//!
2222
//! let v = Vector2d::new(3.0, 4.0);
2323
//! let normalized = v.normalize().unwrap();
@@ -42,7 +42,7 @@ use std::ops::{Add, Mul, Neg, Sub};
4242
/// # Examples
4343
///
4444
/// ```rust
45-
/// use mathrc::vector::Vector2d;
45+
/// use mathrc::Vector2d;
4646
///
4747
/// let v = Vector2d::new(1.0, 2.0);
4848
///
@@ -64,7 +64,7 @@ impl<T: Float> Vector2d<T> {
6464
/// # Examples
6565
///
6666
/// ```rust
67-
/// use mathrc::vector::Vector2d;
67+
/// use mathrc::Vector2d;
6868
///
6969
/// let v = Vector2d::new(3.0, 4.0);
7070
///
@@ -80,7 +80,7 @@ impl<T: Float> Vector2d<T> {
8080
/// # Examples
8181
///
8282
/// ```rust
83-
/// use mathrc::vector::Vector2d;
83+
/// use mathrc::Vector2d;
8484
///
8585
/// let v = Vector2d::new(1.0, 2.0);
8686
/// let vec = v.to_vec();
@@ -102,7 +102,7 @@ where
102102
/// # Examples
103103
///
104104
/// ```rust
105-
/// use mathrc::vector::{Vector2d, VectorOps};
105+
/// use mathrc::{Vector2d, VectorOps};
106106
///
107107
/// let a = Vector2d::new(1.0, 2.0);
108108
/// let b = Vector2d::new(3.0, 4.0);
@@ -118,7 +118,7 @@ where
118118
/// # Examples
119119
///
120120
/// ```rust
121-
/// use mathrc::vector::{Vector2d, VectorOps};
121+
/// use mathrc::{Vector2d, VectorOps};
122122
///
123123
/// let v = Vector2d::new(3.0, 4.0);
124124
///
@@ -137,7 +137,7 @@ where
137137
/// # Examples
138138
///
139139
/// ```rust
140-
/// use mathrc::vector::{Vector2d, VectorOps};
140+
/// use mathrc::{Vector2d, VectorOps};
141141
///
142142
/// let v = Vector2d::new(3.0, 4.0);
143143
/// let n = v.normalize().unwrap();

src/vector/vector3d.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//! # Examples
88
//!
99
//! ```rust
10-
//! use mathrc::vector::Vector3d;
10+
//! use mathrc::Vector3d;
1111
//!
1212
//! let a = Vector3d::new(1.0, 2.0, 3.0);
1313
//! let b = Vector3d::new(4.0, 5.0, 6.0);
@@ -18,7 +18,7 @@
1818
//! ```
1919
//!
2020
//! ```rust
21-
//! use mathrc::vector::{Vector3d, VectorOps};
21+
//! use mathrc::{Vector3d, VectorOps};
2222
//!
2323
//! let v = Vector3d::new(3.0, 4.0, 0.0);
2424
//!
@@ -46,7 +46,7 @@ use crate::{
4646
/// # Examples
4747
///
4848
/// ```rust
49-
/// use mathrc::vector::Vector3d;
49+
/// use mathrc::Vector3d;
5050
///
5151
/// let v = Vector3d::new(1.0, 2.0, 3.0);
5252
///
@@ -72,7 +72,7 @@ impl<T: Float> Vector3d<T> {
7272
/// # Examples
7373
///
7474
/// ```rust
75-
/// use mathrc::vector::Vector3d;
75+
/// use mathrc::Vector3d;
7676
///
7777
/// let v = Vector3d::new(1.0, 2.0, 3.0);
7878
///
@@ -87,7 +87,7 @@ impl<T: Float> Vector3d<T> {
8787
/// # Examples
8888
///
8989
/// ```rust
90-
/// use mathrc::vector::Vector3d;
90+
/// use mathrc::Vector3d;
9191
///
9292
/// let v = Vector3d::new(1.0, 2.0, 3.0);
9393
/// let vec = v.to_vec();
@@ -105,7 +105,7 @@ impl<T: Float> Vector3d<T> {
105105
/// # Examples
106106
///
107107
/// ```rust
108-
/// use mathrc::vector::Vector3d;
108+
/// use mathrc::Vector3d;
109109
///
110110
/// let a = Vector3d::new(1.0, 0.0, 0.0);
111111
/// let b = Vector3d::new(0.0, 1.0, 0.0);
@@ -133,7 +133,7 @@ where
133133
/// # Examples
134134
///
135135
/// ```rust
136-
/// use mathrc::vector::{Vector3d, VectorOps};
136+
/// use mathrc::{Vector3d, VectorOps};
137137
///
138138
/// let a = Vector3d::new(1.0, 2.0, 3.0);
139139
/// let b = Vector3d::new(4.0, 5.0, 6.0);
@@ -149,7 +149,7 @@ where
149149
/// # Examples
150150
///
151151
/// ```rust
152-
/// use mathrc::vector::{Vector3d, VectorOps};
152+
/// use mathrc::{Vector3d, VectorOps};
153153
///
154154
/// let v = Vector3d::new(1.0, 2.0, 2.0);
155155
///
@@ -168,7 +168,7 @@ where
168168
/// # Examples
169169
///
170170
/// ```rust
171-
/// use mathrc::vector::{Vector3d, VectorOps};
171+
/// use mathrc::{Vector3d, VectorOps};
172172
///
173173
/// let v = Vector3d::new(3.0, 4.0, 0.0);
174174
/// let n = v.normalize().unwrap();

0 commit comments

Comments
 (0)