mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2026-12-02 16:37:32 -06:00
This commit - formats the Rust examples idiomatically - uses idiomatic code - uses only safe code without compromising on performance - makes them compile on stable
6 lines
162 B
Rust
6 lines
162 B
Rust
pub fn max_array(x: &mut [f64; 65536], y: &[f64; 65536]) {
|
|
for (x, y) in x.iter_mut().zip(y.iter_mut()) {
|
|
*x = if *y > *x { *y } else { *x };
|
|
}
|
|
}
|