diff --git a/examples/bare3.rs b/examples/bare3.rs index d11e6e4f907417e08b50a3240b0e7c7b4afa9804..76b934572a7eebf0817f057ff4c12bae667f6734 100644 --- a/examples/bare3.rs +++ b/examples/bare3.rs @@ -37,11 +37,10 @@ fn main() -> ! { hprintln!("iterate iterate using (raw) indexing").unwrap(); for i in 0..s.len() { hprintln!("{},", bs[i]).unwrap(); - a[i] = bs[i]; } hprintln!("").unwrap(); - + a.clone_from_slice(&bs[..]); //Copies from bs into a hprintln!("").unwrap(); hprintln!("a = {}", core::str::from_utf8(&a).unwrap()).unwrap();