Skip to content

Commit 9e68360

Browse files
committed
Disabled doctests in Cargo.toml instead of marking them as text
1 parent 8ac5b65 commit 9e68360

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ description = "A simple generic N-dimensional matrix library"
1414
categories = ["data-structures"]
1515
keywords = ["simple", "matrix", "matrices", "dimension"]
1616

17+
[lib]
18+
doctest = false
19+
1720
[features]
1821
impl_from = []
1922

src/matrix.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ impl<T> Matrix<T> {
2121
/// Panics if either `rows` or `cols` are equal to `0`
2222
///
2323
/// # Examples
24-
/// ```text
24+
/// ```rust
2525
/// let mut mat: Matrix<i32> = Matrix::new(3, 6);
2626
/// ```
2727
pub fn new(rows: usize, cols: usize) -> Matrix<T>
@@ -41,7 +41,7 @@ impl<T> Matrix<T> {
4141
/// Panics if the iterator does not have `rows * cols` values
4242
///
4343
/// # Examples
44-
/// ```text
44+
/// ```rust
4545
/// let mat: Matrix<usize> = Matrix::new(3, 6, 0..);
4646
///
4747
/// assert_eq!(mat.get(0, 0).unwrap(), 0);
@@ -65,7 +65,7 @@ impl<T> Matrix<T> {
6565
/// Returns the number of rows in the matrix.
6666
///
6767
/// # Examples
68-
/// ```text
68+
/// ```rust
6969
/// let mat: Matrix<usize> = Matrix::new(3, 6, 0..);
7070
///
7171
/// assert_eq!(mat.rows(), 3);
@@ -77,7 +77,7 @@ impl<T> Matrix<T> {
7777
/// Returns the number of columns in the matrix.
7878
///
7979
/// # Examples
80-
/// ```text
80+
/// ```rust
8181
/// let mat: Matrix<usize> = Matrix::new(3, 6, 0..);
8282
///
8383
/// assert_eq!(mat.cols(), 6);
@@ -90,7 +90,7 @@ impl<T> Matrix<T> {
9090
/// Returns `None` if `row` or `col` is outside of the matrix.
9191
///
9292
/// # Examples
93-
/// ```text
93+
/// ```rust
9494
/// let mat: Matrix<usize> = Matrix::new(3, 6, 0..);
9595
///
9696
/// assert_eq!(mat.get(0, 0).unwrap(), 0);
@@ -110,7 +110,7 @@ impl<T> Matrix<T> {
110110
/// Returns `None` if `row` or `col` is outside of the matrix.
111111
///
112112
/// # Examples
113-
/// ```text
113+
/// ```rust
114114
/// let mut mat: Matrix<usize> = Matrix::new(3, 6, 0..);
115115
/// assert_eq!(mat.get(0, 0).unwrap(), 0);
116116
///
@@ -132,7 +132,7 @@ impl<T> Matrix<T> {
132132
/// Returns `true` if the cell has been modified.
133133
///
134134
/// # Examples
135-
/// ```text
135+
/// ```rust
136136
/// let mut mat: Matrix<usize> = Matrix::new(3, 6, 0..);
137137
/// assert_eq!(mat.get(0, 0).unwrap(), 0);
138138
///
@@ -152,7 +152,7 @@ impl<T> Matrix<T> {
152152
/// Returns `None` if given row is outside of the matrix.
153153
///
154154
/// # Examples
155-
/// ```text
155+
/// ```rust
156156
/// let mat: Matrix<usize> = Matrix::new(3, 6, 0..);
157157
///
158158
/// assert_eq!(mat.get_row(1).unwrap(), vec![6, 7, 8, 9, 10, 11]);
@@ -171,7 +171,7 @@ impl<T> Matrix<T> {
171171
/// Returns `None` if given row is outside of the matrix.
172172
///
173173
/// # Examples
174-
/// ```text
174+
/// ```rust
175175
/// let mat: Matrix<usize> = Matrix::new(3, 6, 0..);
176176
///
177177
/// assert_eq!(mat.get_col(1).unwrap(), vec![1, 7, 13]);
@@ -189,7 +189,7 @@ impl<T> Matrix<T> {
189189
/// Take a *M*x*N* Matrix and construct the transposed *N*x*M* Matrix.
190190
///
191191
/// # Examples
192-
/// ```text
192+
/// ```rust
193193
/// let mat: Matrix<usize> = Matrix::new(3, 6, 0..);
194194
/// let mat_t = mat.transpose();
195195
///
@@ -223,7 +223,7 @@ impl<T> Matrix<T> {
223223
/// if you want to modify the cells, use `apply_mut`.
224224
///
225225
/// # Examples
226-
/// ```text
226+
/// ```rust
227227
/// // Get the sum of all cells
228228
/// let mat: Matrix<usize> = Matrix::new(3, 6, 0..);
229229
/// let mut sum = 0;
@@ -240,7 +240,7 @@ impl<T> Matrix<T> {
240240
/// and can therefore be modified.
241241
///
242242
/// # Examples
243-
/// ```text
243+
/// ```rust
244244
/// // Modify all cells with a function
245245
/// let mut mat: Matrix<usize> = Matrix::new(3, 6, 0..);
246246
/// mat.apply_mut(|n| n *= 2);

0 commit comments

Comments
 (0)