Skip to content

Commit 0a8865b

Browse files
committed
docs: run doctests against README
1 parent f9fe526 commit 0a8865b

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ The following Rust code draws the cube which is included as an example in the
2121
original `ln` repo.
2222

2323
```rust
24-
use raydeon::shapes::RectPrism;
24+
use raydeon::shapes::AxisAlignedCuboid;
2525
use raydeon::{Camera, Scene, WPoint3, WVec3};
2626
use std::sync::Arc;
2727

28-
fn main() {
29-
env_logger::Builder::from_default_env()
30-
.format_timestamp_nanos()
31-
.init();
28+
env_logger::Builder::from_default_env()
29+
.format_timestamp_nanos()
30+
.init();
3231

33-
let scene = Scene::new(vec![Arc::new(RectPrism::new(
32+
fn main() {
33+
let scene = Scene::new(vec![Arc::new(AxisAlignedCuboid::new(
3434
WVec3::new(-1.0, -1.0, -1.0),
3535
WVec3::new(1.0, 1.0, 1.0),
3636
))]);
@@ -45,7 +45,7 @@ fn main() {
4545
let znear = 0.1;
4646
let zfar = 10.0;
4747

48-
let camera = Camera::look_at(eye, focus, up).perspective(fovy, width, height, znear, zfar);
48+
let camera = Camera::new().look_at(eye, focus, up).perspective(fovy, width, height, znear, zfar);
4949

5050
let paths = scene.attach_camera(camera).render();
5151

raydeon/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#[doc = include_str!("../../README.md")]
12
pub(crate) mod bvh;
23
pub mod camera;
34
pub mod path;

0 commit comments

Comments
 (0)