Skip to content

Commit

Permalink
Merge pull request #11 from Martin005/fix-generator-example
Browse files Browse the repository at this point in the history
Update generator example in developer.md
  • Loading branch information
Manishearth authored Feb 3, 2025
2 parents 5f3e35f + d973099 commit 2bb285e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,11 @@ mod test {

}
};
let item = syn::parse2::<syn::File>(tokens).expect("failed to parse item ");
let file = syn::parse2::<syn::File>(tokens).expect("failed to parse item ");

let diplomat_file = ast::File::from(&item);
let env = diplomat_file.all_types();
let attr_validator = hir::BasicAttributeValidator::new("my_backend_test");

let context = match hir::TypeContext::from_ast(&env, attr_validator) {
let context = match hir::TypeContext::from_syn(&file, attr_validator) {
Ok(context) => context,
Err(e) => {
for (_cx, err) in e {
Expand Down

0 comments on commit 2bb285e

Please sign in to comment.