1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-05-16 07:36:05 +02:00

Replace closure map example with direct calls (#2679)

This commit is contained in:
Nicole L 2025-02-28 12:51:07 -08:00 committed by GitHub
parent e6bab6fd93
commit c486dd9d80
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -16,10 +16,12 @@ fn main() {
v
}
};
println!(
"clamped values at {max_value}: {:?}",
(0..10).map(clamp).collect::<Vec<_>>()
);
dbg!(clamp(1));
dbg!(clamp(3));
dbg!(clamp(5));
dbg!(clamp(7));
dbg!(clamp(10));
}
```