Skip to content

Commit

Permalink
Properly rename module
Browse files Browse the repository at this point in the history
  • Loading branch information
gyscos committed Jul 27, 2024
1 parent 2b2f066 commit a3e0e8b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
File renamed without changes.
8 changes: 7 additions & 1 deletion cursive/examples/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,22 @@ use cursive::views::{BoxedView, Button, EditView, Panel, TextView};
// This is how we can define some global blueprints.
// Here, we define a blueprint from a template.
cursive::manual_blueprint!(LabeledField from {
// We just need to return a cursive::builder::Config here
// We just need to return a cursive::builder::Config
// (in practice, a serde_json::Value).
//
// Here we parse yaml but any other serde-supported language would work.
serde_yaml::from_str(include_str!("label-view.yaml")).unwrap()
});

cursive::manual_blueprint!(VSpace from {
// Another similar blueprint.
//
// Here we embed the template in the binary with `include_str!`,
// but it'd be possible as well to dynamically read a file,
// load from network, ...
//
// Note that this code only runs when this blueprint is actually called
// (when a `VSpace` view is requested).
serde_yaml::from_str(include_str!("vspace.yaml")).unwrap()
});

Expand Down

0 comments on commit a3e0e8b

Please sign in to comment.