Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upremoved unsafe code in favor of explicit assert #32
Conversation
This comment has been minimized.
This comment has been minimized.
|
Ah, I love clever compilers. I love clever people, too. ☺ Thanks for going to the trouble of confirming the compiled result. I see from this that simply changing the A matter of style: I’d prefer writing out Thanks for this contribution. I should once more think about releasing 1.0. |
hellow554
force-pushed the
hellow554:master
branch
from
c2944ef
to
479d756
Nov 13, 2018
This comment has been minimized.
This comment has been minimized.
|
Rebased and pushed ;) Glad to help! |
This comment has been minimized.
This comment has been minimized.
|
BTW, the explanation and justification you put in the PR description would make a good commit message. I encourage you to get in the habit of writing long commit messages, if you’re not already, typically with explanations as to why things changed, just as you would normally need to to get changes accepted into an open source project. That sort of thing is quite often very useful later on. Embrace the long commit messages! (I try to convince people of this often; in my day job at FastMail I hold nine or ten of the top ten longest commit messages—some may think I take it too far; but I find it occurs surprisingly often that when I’m defending my work in a commit message, or even explaining what I did, I realise why the solution won’t work in certain cases, or is inferior to another.) |
hellow554 commentedNov 13, 2018
•
edited
converting a
*u8to a*u64is/could be unsafe, because of different alignment.This PR will have no runtime effect, because
assert!influences the code generated by rust/llvm, so they are equal, but less unsafe :)https://rust.godbolt.org/z/FXkwB2