Skip to content

Commit

Permalink
Added methods to set and add bytes and str
Browse files Browse the repository at this point in the history
  • Loading branch information
mjhouse committed Mar 26, 2024
1 parent e0268bf commit b333ed2
Show file tree
Hide file tree
Showing 2 changed files with 530 additions and 21 deletions.
12 changes: 6 additions & 6 deletions examples/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ fn main() -> Result<()> {
.with_data(DataWord::try_from("Y ")?)
.build()?;

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

println!("{}", word0.as_string().unwrap());
println!("{}", word1.as_string().unwrap());
println!("{}", word2.as_string().unwrap());
println!("{}", word0);
println!("{}", word1);
println!("{}", word2);

Ok(())
}
Loading

0 comments on commit b333ed2

Please sign in to comment.