Skip to content

Commit a1a3841

Browse files
committed
Fix broken doc-test
1 parent a42b67d commit a1a3841

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/lib.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,16 @@ impl Object {
158158
/// If the function does not fail, you can (and probably will have to) use [`Infallible`][std::convert::Infallible]:
159159
///
160160
/// ```no_run
161-
/// # let object = Object::read_from(&[0u8]);
162-
/// object.walk_nodes<Infallible, _>(0, |node| println!("{:?}", node));
161+
/// # use rgbds_obj::Object;
162+
/// # use std::convert::Infallible;
163+
/// # use std::fs::File;
164+
/// #
165+
/// # let input = File::open("camera.o").unwrap();
166+
/// # let object = Object::read_from(&input).unwrap();
167+
/// object.walk_nodes::<Infallible, _>(0, &mut |node| {
168+
/// println!("{:?}", node);
169+
/// Ok(())
170+
/// });
163171
/// ```
164172
pub fn walk_nodes<E, F>(&self, id: u32, callback: &mut F) -> Result<(), NodeWalkError<E>>
165173
where

0 commit comments

Comments
 (0)