Skip to content

Commit 8d53b4d

Browse files
committed
Fix rustdoc warnings and indent errors
1 parent 789eaf6 commit 8d53b4d

23 files changed

+341
-362
lines changed

cfavml/src/danger/export_agg_ops.rs

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,7 @@ macro_rules! define_sum_impl {
1414
) => {
1515
#[inline]
1616
$(#[target_feature($(enable = $feat, )*)])*
17-
#[doc = r#"
18-
Performs a horizontal sum of all elements in vector `a` of size `dims` returning the total.
19-
20-
### Pseudocode
21-
22-
```ignore
23-
result = 0
24-
25-
for i in range(dims):
26-
result += a[i]
27-
28-
return result
29-
```
30-
31-
# Safety
32-
33-
This routine assumes:
34-
"#]
17+
#[doc = include_str!("../export_docs/agg_horizontal_sum.md")]
3518
$(
3619

3720
#[doc = concat!("- ", $("**`+", $feat, "`** ", )*)]

cfavml/src/danger/export_arithmetic_ops.rs

Lines changed: 8 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -31,24 +31,7 @@ macro_rules! define_arithmetic_impls {
3131
) => {
3232
#[inline]
3333
$(#[target_feature($(enable = $feat, )*)])*
34-
#[doc = r#"
35-
Adds a single value to each element in vector `a` of size `dims`.
36-
37-
### Pseudocode
38-
39-
```ignore
40-
result = [0; dims]
41-
42-
for i in range(dims):
43-
result[i] = a[i] + value
44-
45-
return result
46-
```
47-
48-
# Safety
49-
50-
This routine assumes:
51-
"#]
34+
#[doc = include_str!("../export_docs/arithmetic_add_value.md")]
5235
$(
5336

5437
#[doc = concat!("- ", $("**`+", $feat, "`** ", )*)]
@@ -80,25 +63,7 @@ macro_rules! define_arithmetic_impls {
8063

8164
#[inline]
8265
$(#[target_feature($(enable = $feat, )*)])*
83-
#[doc = r#"
84-
Performs an element wise add of `a` and `b` of size `dims` and store the result
85-
in `result` vector of size `dims`.
86-
87-
### Pseudocode
88-
89-
```ignore
90-
result = [0; dims]
91-
92-
for i in range(dims):
93-
result[i] = a[i] + b[i]
94-
95-
return result
96-
```
97-
98-
# Safety
99-
100-
This routine assumes:
101-
"#]
66+
#[doc = include_str!("../export_docs/arithmetic_add_vector.md")]
10267
$(
10368

10469
#[doc = concat!("- ", $("**`+", $feat, "`** ", )*)]
@@ -130,24 +95,7 @@ macro_rules! define_arithmetic_impls {
13095

13196
#[inline]
13297
$(#[target_feature($(enable = $feat, )*)])*
133-
#[doc = r#"
134-
Subtracts a single value from each element in vector `a` of size `dims`.
135-
136-
### Pseudocode
137-
138-
```ignore
139-
result = [0; dims]
140-
141-
for i in range(dims):
142-
result[i] = a[i] - value
143-
144-
return result
145-
```
146-
147-
# Safety
148-
149-
This routine assumes:
150-
"#]
98+
#[doc = include_str!("../export_docs/arithmetic_sub_value.md")]
15199
$(
152100

153101
#[doc = concat!("- ", $("**`+", $feat, "`** ", )*)]
@@ -179,25 +127,7 @@ macro_rules! define_arithmetic_impls {
179127

180128
#[inline]
181129
$(#[target_feature($(enable = $feat, )*)])*
182-
#[doc = r#"
183-
Performs an element wise subtraction of `a` and `b` of size `dims` and store the result
184-
in `result` vector of size `dims`.
185-
186-
### Pseudocode
187-
188-
```ignore
189-
result = [0; dims]
190-
191-
for i in range(dims):
192-
result[i] = a[i] - b[i]
193-
194-
return result
195-
```
196-
197-
# Safety
198-
199-
This routine assumes:
200-
"#]
130+
#[doc = include_str!("../export_docs/arithmetic_sub_vector.md")]
201131
$(
202132

203133
#[doc = concat!("- ", $("**`+", $feat, "`** ", )*)]
@@ -229,24 +159,7 @@ macro_rules! define_arithmetic_impls {
229159

230160
#[inline]
231161
$(#[target_feature($(enable = $feat, )*)])*
232-
#[doc = r#"
233-
Multiplies each element in vector `a` of size `dims` by `value`.
234-
235-
### Pseudocode
236-
237-
```ignore
238-
result = [0; dims]
239-
240-
for i in range(dims):
241-
result[i] = a[i] * value
242-
243-
return result
244-
```
245-
246-
# Safety
247-
248-
This routine assumes:
249-
"#]
162+
#[doc = include_str!("../export_docs/arithmetic_mul_value.md")]
250163
$(
251164

252165
#[doc = concat!("- ", $("**`+", $feat, "`** ", )*)]
@@ -278,25 +191,7 @@ macro_rules! define_arithmetic_impls {
278191

279192
#[inline]
280193
$(#[target_feature($(enable = $feat, )*)])*
281-
#[doc = r#"
282-
Performs an element wise multiplication of `a` and `b` of size `dims` and store the result
283-
in `result` vector of size `dims`.
284-
285-
### Pseudocode
286-
287-
```ignore
288-
result = [0; dims]
289-
290-
for i in range(dims):
291-
result[i] = a[i] * b[i]
292-
293-
return result
294-
```
295-
296-
# Safety
297-
298-
This routine assumes:
299-
"#]
194+
#[doc = include_str!("../export_docs/arithmetic_mul_vector.md")]
300195
$(
301196

302197
#[doc = concat!("- ", $("**`+", $feat, "`** ", )*)]
@@ -328,24 +223,7 @@ macro_rules! define_arithmetic_impls {
328223

329224
#[inline]
330225
$(#[target_feature($(enable = $feat, )*)])*
331-
#[doc = r#"
332-
Divides each element in vector `a` of size `dims` by `value`.
333-
334-
### Pseudocode
335-
336-
```ignore
337-
result = [0; dims]
338-
339-
for i in range(dims):
340-
result[i] = a[i] / value
341-
342-
return result
343-
```
344-
345-
# Safety
346-
347-
This routine assumes:
348-
"#]
226+
#[doc = include_str!("../export_docs/arithmetic_div_value.md")]
349227
$(
350228

351229
#[doc = concat!("- ", $("**`+", $feat, "`** ", )*)]
@@ -377,25 +255,7 @@ macro_rules! define_arithmetic_impls {
377255

378256
#[inline]
379257
$(#[target_feature($(enable = $feat, )*)])*
380-
#[doc = r#"
381-
Performs an element wise division of `a` and `b` of size `dims` and store the result
382-
in `result` vector of size `dims`.
383-
384-
### Pseudocode
385-
386-
```ignore
387-
result = [0; dims]
388-
389-
for i in range(dims):
390-
result[i] = a[i] / b[i]
391-
392-
return result
393-
```
394-
395-
# Safety
396-
397-
This routine assumes:
398-
"#]
258+
#[doc = include_str!("../export_docs/arithmetic_div_vector.md")]
399259
$(
400260

401261
#[doc = concat!("- ", $("**`+", $feat, "`** ", )*)]

cfavml/src/danger/export_cmp_ops.rs

Lines changed: 6 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,7 @@ macro_rules! define_max_impls {
2525
) => {
2626
#[inline]
2727
$(#[target_feature($(enable = $feat, )*)])*
28-
#[doc = r#"
29-
Takes the element wise max of two vectors of size `dims` and stores the result
30-
in `result` of size `dims`.
31-
32-
### Pseudocode
33-
34-
```ignore
35-
result = [0; dims]
36-
37-
for i in range(dims):
38-
result[i] = max(a[i], b[i])
39-
40-
return result
41-
```
42-
43-
# Safety
44-
45-
This routine assumes:
46-
"#]
28+
#[doc = include_str!("../export_docs/cmp_max_vector.md")]
4729
$(
4830

4931
#[doc = concat!("- ", $("**`+", $feat, "`** ", )*)]
@@ -75,25 +57,7 @@ macro_rules! define_max_impls {
7557

7658
#[inline]
7759
$(#[target_feature($(enable = $feat, )*)])*
78-
#[doc = r#"
79-
Takes the element wise max of the provided broadcast value and a vector of size `dims`
80-
and stores the result in `result` of size `dims`.
81-
82-
### Pseudocode
83-
84-
```ignore
85-
result = [0; dims]
86-
87-
for i in range(dims):
88-
result[i] = max(value, a[i])
89-
90-
return result
91-
```
92-
93-
# Safety
94-
95-
This routine assumes:
96-
"#]
60+
#[doc = include_str!("../export_docs/cmp_max_value.md")]
9761
$(
9862

9963
#[doc = concat!("- ", $("**`+", $feat, "`** ", )*)]
@@ -126,25 +90,7 @@ macro_rules! define_max_impls {
12690

12791
#[inline]
12892
$(#[target_feature($(enable = $feat, )*)])*
129-
#[doc = r#"
130-
Performs a horizontal max of all elements in the provided vector `a` of size `dims`
131-
returning the max value.
132-
133-
### Pseudocode
134-
135-
```ignore
136-
result = -inf
137-
138-
for i in range(dims):
139-
result = max(result, a[i])
140-
141-
return result
142-
```
143-
144-
# Safety
145-
146-
This routine assumes:
147-
"#]
93+
#[doc = include_str!("../export_docs/cmp_max_horizontal.md")]
14894
$(
14995

15096
#[doc = concat!("- ", $("**`+", $feat, "`** ", )*)]
@@ -212,25 +158,7 @@ macro_rules! define_min_impls {
212158
) => {
213159
#[inline]
214160
$(#[target_feature($(enable = $feat, )*)])*
215-
#[doc = r#"
216-
Takes the element wise min of two vectors of size `dims` and stores the result
217-
in `result` of size `dims`.
218-
219-
### Pseudocode
220-
221-
```ignore
222-
result = [0; dims]
223-
224-
for i in range(dims):
225-
result[i] = min(a[i], b[i])
226-
227-
return result
228-
```
229-
230-
# Safety
231-
232-
This routine assumes:
233-
"#]
161+
#[doc = include_str!("../export_docs/cmp_min_vector.md")]
234162
$(
235163

236164
#[doc = concat!("- ", $("**`+", $feat, "`** ", )*)]
@@ -262,25 +190,7 @@ macro_rules! define_min_impls {
262190

263191
#[inline]
264192
$(#[target_feature($(enable = $feat, )*)])*
265-
#[doc = r#"
266-
Takes the element wise min of the provided broadcast value and a vector of size `dims`
267-
and stores the result in `result` of size `dims`.
268-
269-
### Pseudocode
270-
271-
```ignore
272-
result = [0; dims]
273-
274-
for i in range(dims):
275-
result[i] = min(value, a[i])
276-
277-
return result
278-
```
279-
280-
# Safety
281-
282-
This routine assumes:
283-
"#]
193+
#[doc = include_str!("../export_docs/cmp_min_value.md")]
284194
$(
285195

286196
#[doc = concat!("- ", $("**`+", $feat, "`** ", )*)]
@@ -313,25 +223,7 @@ macro_rules! define_min_impls {
313223

314224
#[inline]
315225
$(#[target_feature($(enable = $feat, )*)])*
316-
#[doc = r#"
317-
Performs a horizontal min of all elements in the provided vector `a` of size `dims`
318-
returning the min value.
319-
320-
### Pseudocode
321-
322-
```ignore
323-
result = -inf
324-
325-
for i in range(dims):
326-
result = min(result, a[i])
327-
328-
return result
329-
```
330-
331-
# Safety
332-
333-
This routine assumes:
334-
"#]
226+
#[doc = include_str!("../export_docs/cmp_min_horizontal.md")]
335227
$(
336228

337229
#[doc = concat!("- ", $("**`+", $feat, "`** ", )*)]

0 commit comments

Comments
 (0)