aturon / aturon.github.io Goto Github PK
View Code? Open in Web Editor NEWturon's web site
License: Other
turon's web site
License: Other
@aturon: https://aturon.github.io/ownership/builders.html claims, that non-consuming builder pattern works with the _one-liner-pattern. I think this is wrong - the following code does not compile (copy-paste this to https://play.rust-lang.org/)
#[derive(Debug, Default)]
struct Channel {
special_info: i32
}
impl Channel {
fn special_info<VALUE: Into<i32>>(&mut self, value: VALUE) -> &mut Self {
self.special_info = value.into();
self
}
}
fn main() {
let ch = Channel::default().special_info(42);
println!("{:?}", ch);
}
results in
error: borrowed value does not live long enough
--> <anon>:14:14
14 |> let ch = Channel::default().special_info(42);
|> ^^^^^^^^^^^^^^^^^^ does not live long enough
note: reference must be valid for the block suffix following statement 0 at 14:49...
--> <anon>:14:50
14 |> let ch = Channel::default().special_info(42);
|> ^
note: ...but borrowed value is only valid for the statement at 14:4
--> <anon>:14:5
14 |> let ch = Channel::default().special_info(42);
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: consider using a `let` binding to increase its lifetime
--> <anon>:14:5
14 |> let ch = Channel::default().special_info(42);
|> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to previous error
Therefore I would argue that the consuming-pattern should be the preferred choice to support the one-liner-pattern.
CC @killercup
The body text disappeared from http://aturon.github.io/blog/2017/02/06/specialization-and-coherence/, though it is at http://aturon.github.io/2017/02/06/specialization-and-coherence/ . I don't see any other obvious ones missing from ebd9086 .
It looks like static.rust-lang.org can now be accessed with HTTPS, so this should be done.
Should be a one character change here: https://github.com/aturon/aturon.github.io/blob/master/rust-book.css#L2.
The documentation at https://aturon.github.io/style/naming/containers.html:
For Result<V, E>:
// Extract the contents of Ok variant; fail if Err
fn assert(self) -> V
// Extract the contents of Err variant; fail if Ok
fn assert_err(self) -> E
This is out of date, according to the documentation of std
and IRC conversation.
Currently https://aturon.github.io is the number 1 hit on Google for "rust style guide" but it seems to be an old snapshot. Could this instead point to https://github.com/rust-lang-nursery/fmt-rfcs, so that people would be directed to the latest guidelines?
I guess it only happens to the unlucky, but a few find stability-dashboard 's outdated rust docs and don't see that it's out of date or unofficial.
A Google search for "Rust naming conventions" returns https://aturon.github.io/style/naming.html as the top hit. But this is a three-year-old snapshot; it would be much better for people to refer to https://rust-lang-nursery.github.io/api-guidelines/naming.html which is current.
Is there any chance you could retire this snapshot, or at least add pointers to more recent docs?
Thanks!
I really enjoyed the listening and trust series, but it appears the pages have been moved and the links are now broken.
I can find this via search engine https://aturon.github.io/ownership/builders.html
but it's 404
With a friend of mine, we are coding in rust and we don't know if we should write documentation this way :
/// documentation
fn myfn() {
}
or this way :
/// documentation
fn myfn() {
}
This may seems silly, but you know, choosing style guideline always end up in holy war.
The Realworld implementation in Rust references aturon.github.io/README.md.
It returns 404 now. It had a book called Rust Guidelines before that.
Are those guidelines still available anywhere? Is there a better alternative? Or should they perhaps just remove the link completely?
The blog here: https://aturon.github.io/blog/
Has different dates for the posts compared to the RSS feed here: https://aturon.github.io/blog/atom.xml
It's making things look quite odd (and confusing) in my RSS reader.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.