Skip to content

Commit

Permalink
doc: update project setup instructions
Browse files Browse the repository at this point in the history
Correct the code samples in the guide to use the new APIs for generating
Rust code and including the files.
  • Loading branch information
dnaka91 committed Nov 5, 2023
1 parent ca222db commit 66b95bf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions book/src/guide/generating.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The main entry point is the `stef-build` crate, which you use as build script in

```rust
fn main() {
stef_build::compile(&["src/sample.stef"], &["src/"]).unwrap();
stef_build::Compiler::default().compile(&["src/sample.stef"]).unwrap();
}
```

Expand All @@ -24,7 +24,7 @@ Continuing on the previous example, the generated could could be included like t
// in src/main.rs

mod sample {
include!(concat!(env!("OUT_DIR"), "/sample.rs"));
stef::include!("sample");
}

fn main() {
Expand All @@ -51,7 +51,7 @@ Then we could use the generated struct as follows:
use stef::Encode;
mod sample {
include!(concat!(env!("OUT_DIR"), "/sample.rs"));
stef::include!("sample");
}
fn main() {
Expand Down

0 comments on commit 66b95bf

Please sign in to comment.