-
Notifications
You must be signed in to change notification settings - Fork 6
[Draft] Let Statements #14
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
Comments
in |
Put the noncompliant example first followed by the compliant solution |
Done, let me know if there is something else |
Hi @x0rw -- thanks for bringing this topic!
I found the easiest way was to right click on the section number and then click Inspect: |
Thanks, that's easier.
|
Hey there @x0rw -- I'd say to use your best judgement. I'd be surprised if there is no paragraph ID, but it may be possible. Could you explain a little more about what you're finding hard about it? |
Re:Content: A trick that might worth integrating to reduce the mutable scope of locals if mutability is required temporarily: let thing = {
let mut thing = ...;
do_the_mutable(&mut thing);
thing
};
// now thing is immutable from here on |
Hey Veykril, I wonder if this should be added as a whole subsection or just as a sidenote or alternative. |
Can someone review, and show me how do i properly link each point to FLS?
Note: This is a preliminary draft and has not yet been formatted in reStructuredText (.rst) format
Ferrocene spec - let statements
1.1 Always Initialize Variables Before Use
bad example:
good example:
1.2 Prefer Immutable Bindings
Rationale:
(couldn't come up with an example)
1.3 Use Explicit Types for Critical Values
Rationale
bad example:
good example:
1.4 Avoid Shadowing
Rationale
bad example:
good example:
Another point: How do I ensure that the examples do not violate other guidelines?
Also, should the use of
mut
require documentation or a comment?The text was updated successfully, but these errors were encountered: