Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code example doesn't compile #14

Open
diondokter opened this issue Jan 25, 2024 · 1 comment
Open

Code example doesn't compile #14

diondokter opened this issue Jan 25, 2024 · 1 comment

Comments

@diondokter
Copy link
Collaborator

@hdoordt

https://github.com/tweedegolf/rust-workshop/blob/eb901ff9b2984177e5baea397abd335be52f1df7/slides/A-intro-to-rust.md#L1995

All these a,b,c,d have to be cast to u32. But that doesn't look nice...
So... Should we change it?

@squell
Copy link
Collaborator

squell commented Aug 7, 2024

During the last training I did, this was a nice moment to re-inforce the point that Rust is quite strict on integer conversions (although I'd prefer these kind of safe upcasts were allowed). I.e.

  • Either we fix this error, but that would require finding a 'nicer' example; I'm pretty sure those exists.
  • Or we own up to it (we could even add a slide after this one that goes "woops, it didnd't compile, here's how to fix it")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants