for (i, &item) in bytes.iter().enumerate() ...
fn addsub(x: i32, y: i32) -> (i32, i32) {
(x + y, x - y)
}
let (a, b) = addsub(1, 2);
Syntax is nice:
&a[..] <-whole
&a[3..7] <-sub
struct Rectangle {
width: u32,
height: u32,
}
impl Rectangle {
fn area(&self) -> u32 {
self.width * self.height
}
}
aras-p.info/blog/2018/12/2…