|
2 | 2 | //! automatically generate code from a given struct `T` that allow to replace
|
3 | 3 | //! `Vec<T>` with a struct of arrays. For example, the following code
|
4 | 4 | //!
|
5 |
| -//! ```ignore |
| 5 | +//! ``` |
6 | 6 | //! # #[macro_use] extern crate soa_derive;
|
7 | 7 | //! # fn main() {
|
8 | 8 | //! #[derive(StructOfArray)]
|
|
17 | 17 | //!
|
18 | 18 | //! will generate a `CheeseVec` struct that looks like this:
|
19 | 19 | //!
|
20 |
| -//! ```ignore |
| 20 | +//! ``` |
21 | 21 | //! pub struct CheeseVec {
|
22 | 22 | //! pub smell: Vec<f64>,
|
23 | 23 | //! pub color: Vec<(f64, f64, f64)>,
|
|
38 | 38 | //! (such as `Debug` or `PartialEq`), you can add an attribute `#[soa_derive =
|
39 | 39 | //! "Debug, PartialEq"]` to the struct declaration.
|
40 | 40 | //!
|
41 |
| -//! ```ignore |
| 41 | +//! ``` |
42 | 42 | //! # #[macro_use] extern crate soa_derive;
|
43 | 43 | //! # fn main() {
|
44 | 44 | //! #[derive(Debug, PartialEq, StructOfArray)]
|
|
57 | 57 | //! attribute `#[soa_attr(Vec, cfg_attr(test, derive(PartialEq)))]` to the
|
58 | 58 | //! struct declaration.
|
59 | 59 | //!
|
60 |
| -//! ```ignore |
| 60 | +//! ``` |
61 | 61 | //! # #[macro_use] extern crate soa_derive;
|
62 | 62 | //! # fn main() {
|
63 | 63 | //! #[derive(Debug, PartialEq, StructOfArray)]
|
|
108 | 108 | //!
|
109 | 109 | //! It is possible to iterate over the values in a `CheeseVec`
|
110 | 110 | //!
|
111 |
| -//! ```ignore |
| 111 | +//! ```no_run |
112 | 112 | //! # #[macro_use] extern crate soa_derive;
|
113 | 113 | //! # fn main() {
|
114 | 114 | //! # #[derive(Debug, PartialEq, StructOfArray)]
|
|
136 | 136 | //! fields from memory when iterating over the vector. In order to do so, one
|
137 | 137 | //! can manually pick the needed fields:
|
138 | 138 | //!
|
139 |
| -//! ```ignore |
| 139 | +//! ```no_run |
140 | 140 | //! # #[macro_use] extern crate soa_derive;
|
141 | 141 | //! # fn main() {
|
142 | 142 | //! # #[derive(Debug, PartialEq, StructOfArray)]
|
|
161 | 161 | //! In order to iterate over multiple fields at the same time, one can use the
|
162 | 162 | //! [soa_zip!](macro.soa_zip.html) macro.
|
163 | 163 | //!
|
164 |
| -//! ```ignore |
| 164 | +//! ```no_run |
165 | 165 | //! # #[macro_use] extern crate soa_derive;
|
166 | 166 | //! # fn main() {
|
167 | 167 | //! # #[derive(Debug, PartialEq, StructOfArray)]
|
|
189 | 189 | //!
|
190 | 190 | //! For example, the following code
|
191 | 191 | //!
|
192 |
| -//! ```ignore |
| 192 | +//! ``` |
| 193 | +//! use soa_derive::StructOfArray; |
193 | 194 | //! #[derive(StructOfArray)]
|
194 | 195 | //! pub struct Point {
|
195 | 196 | //! x: f32,
|
|
205 | 206 | //!
|
206 | 207 | //! will generate structs that looks like this:
|
207 | 208 | //!
|
208 |
| -//! ```ignore |
| 209 | +//! ``` |
209 | 210 | //! pub struct PointVec {
|
210 | 211 | //! x: Vec<f32>,
|
211 | 212 | //! y: Vec<f32>,
|
@@ -315,7 +316,7 @@ pub trait SoAIndexMut<T>: private_soa_indexes::Sealed {
|
315 | 316 | /// to the fields, which can be mutable references if the field name is prefixed
|
316 | 317 | /// with `mut`.
|
317 | 318 | ///
|
318 |
| -/// ```ignore |
| 319 | +/// ``` |
319 | 320 | /// # #[macro_use] extern crate soa_derive;
|
320 | 321 | /// # fn main() {
|
321 | 322 | /// #[derive(StructOfArray)]
|
@@ -346,7 +347,7 @@ pub trait SoAIndexMut<T>: private_soa_indexes::Sealed {
|
346 | 347 | /// iterator will yields elements until any of the fields or one external
|
347 | 348 | /// iterator returns None.
|
348 | 349 | ///
|
349 |
| -/// ```ignore |
| 350 | +/// ``` |
350 | 351 | /// # #[macro_use] extern crate soa_derive;
|
351 | 352 | /// # fn main() {
|
352 | 353 | /// # #[derive(StructOfArray)]
|
|
0 commit comments