From fa6b62c53cb0e3d20bd3e870f360537315ec0582 Mon Sep 17 00:00:00 2001 From: Grumme2 <agh@live.se> Date: Thu, 16 Apr 2020 09:43:30 +0200 Subject: [PATCH] bare3_4 --- examples/bare3.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/bare3.rs b/examples/bare3.rs index d60cd1a..480368f 100644 --- a/examples/bare3.rs +++ b/examples/bare3.rs @@ -26,7 +26,7 @@ fn main() -> ! { hprintln!("iterate over slice").unwrap(); let c: &u8; - for c in bs { + for c in bs { hprint!("{},", c).unwrap(); } @@ -40,7 +40,9 @@ fn main() -> ! { let a: [u8;4] = [65u8; 4]; let mut a = [0u8; 4]; - + for i in 0..bs.len(){ + a[i] = bs[i]; + } hprintln!("").unwrap(); hprintln!("a = {}", core::str::from_utf8(&a).unwrap()).unwrap(); -- GitLab