Skip to content

Commit c145e9e

Browse files
author
torkleyy
committed
Fix documentation example
1 parent 41b9229 commit c145e9e

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/dispatch.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,23 +173,28 @@ impl<'t> Dispatcher<'t> {
173173
/// # extern crate shred;
174174
/// # #[macro_use]
175175
/// # extern crate shred_derive;
176-
/// # use shred::{DispatcherBuilder, Fetch};
177-
/// # struct Res; impl Resource for Res {}
176+
/// # use shred::{DispatcherBuilder, Fetch, Task, Resource};
177+
/// # struct Res;
178+
/// # impl Resource for Res {}
178179
/// # #[derive(TaskData)] #[allow(unused)] struct Data<'a> { a: Fetch<'a, Res> }
179180
/// # struct Dummy;
180-
/// # impl<'a> Task<'a> {
181+
/// # impl<'a> Task<'a> for Dummy {
181182
/// # type TaskData = Data<'a>;
182183
/// #
183-
/// # fn work(&mut self, _: Data<'a>) {}
184+
/// # fn work(&mut self, _: Data<'a>) {}
184185
/// # }
185186
/// #
186-
/// # let (task_a, task_b, task_c, task_d, task_e) = (Dummy, Dummy, Dummy, Dummy, Dummy);
187187
/// # fn main() {
188+
/// # let task_a = Dummy;
189+
/// # let task_b = Dummy;
190+
/// # let task_c = Dummy;
191+
/// # let task_d = Dummy;
192+
/// # let task_e = Dummy;
188193
/// let dispatcher = DispatcherBuilder::new()
189194
/// .add(task_a, "a", &[])
190195
/// .add(task_b, "b", &["a"]) // b depends on a
191196
/// .add(task_c, "c", &["a"]) // c also depends on a
192-
/// .add(task_d, "d" &[])
197+
/// .add(task_d, "d", &[])
193198
/// .add(task_e, "e", &["c", "d"]) // e executes after c and d are finished
194199
/// .finish();
195200
/// # }

0 commit comments

Comments
 (0)