Skip to content

Commit

Permalink
Change default values of flags
Browse files Browse the repository at this point in the history
  • Loading branch information
mjhouse authored Mar 24, 2024
1 parent 27e4c75 commit 40cae9c
Show file tree
Hide file tree
Showing 7 changed files with 136 additions and 158 deletions.
10 changes: 8 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,14 @@ categories = [
]

[features]
default = [ "derive" ]
derive = [ "dep:mil_std_1553b_derive" ]

[dependencies]
mil_std_1553b_derive = { path = "crates/mil_std_1553b_derive", optional = true }
mil_std_1553b_derive = { path = "crates/mil_std_1553b_derive", optional = true }

[[example]]
name = "custom"
required-features = [ "derive" ]

[[example]]
name = "simple"
4 changes: 2 additions & 2 deletions examples/custom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ fn main() {

// Get words by getting the appropriate data word and mapping
// them to our custom word.
let word1 = message.get_as::<CustomWord>(0);
let word2 = message.get_as::<CustomWord>(1);
let word1 = message.get::<CustomWord>(0);
let word2 = message.get::<CustomWord>(1);

// Access the 'status light on' flag of the custom word
let status_light_on_1 = word1.unwrap().status_light_on();
Expand Down
6 changes: 3 additions & 3 deletions examples/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ fn main() -> Result<()> {
.with_data(DataWord::try_from("Y ")?)
.build()?;

let word0 = message.get(0).unwrap();
let word1 = message.get(1).unwrap();
let word2 = message.get(2).unwrap();
let word0 = message.at(0).unwrap();
let word1 = message.at(1).unwrap();
let word2 = message.at(2).unwrap();

println!("{}", word0.as_string().unwrap());
println!("{}", word1.as_string().unwrap());
Expand Down
Loading

0 comments on commit 40cae9c

Please sign in to comment.