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

Be more coincise

This commit is contained in:
LukeMathWalker
2025-07-07 13:34:00 +02:00
parent 93f198051e
commit 41ad768fd6

View File

@ -22,8 +22,8 @@ fn double(n: u64) -> u64 {
double(UserId(1)); // 🛠️❌ double(UserId(1)); // 🛠️❌
``` ```
The Rust compiler won't implicitly convert to (or from) the underlying type.\ The Rust compiler won't let you use methods or operators defined on the
It won't let you use methods or operators defined on the underlying type either: underlying type either:
```rust,compile_fail ```rust,compile_fail
# pub struct UserId(u64); # pub struct UserId(u64);