Skip to content
Snippets Groups Projects
Commit 9f7ef55c authored by Henrik Theolin's avatar Henrik Theolin
Browse files

bare3_5

parent 0b748b14
No related branches found
No related tags found
No related merge requests found
...@@ -30,15 +30,15 @@ fn main() -> ! { ...@@ -30,15 +30,15 @@ fn main() -> ! {
hprint!("{},", c).unwrap(); hprint!("{},", c).unwrap();
} }
let mut a = [0u8; 4];
hprintln!("iterate iterate using (raw) indexing").unwrap(); hprintln!("iterate iterate using (raw) indexing").unwrap();
for i in 0..s.len() { for i in 0..s.len() {
let i: usize = i; let i: usize = i;
a[i] = bs[i];
hprintln!("{},", bs[i]).unwrap(); hprintln!("{},", bs[i]).unwrap();
} }
hprintln!("").unwrap(); hprintln!("").unwrap();
let mut a = [0u8; 4];
a.clone_from_slice(&bs);
hprintln!("").unwrap(); hprintln!("").unwrap();
hprintln!("a = {}", core::str::from_utf8(&a).unwrap()).unwrap(); hprintln!("a = {}", core::str::from_utf8(&a).unwrap()).unwrap();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment