386 private links
[fiction] From C code with a lot of bugs to Rust with improvments
&str, String or &String ?
In most cases, &str is what is needed.
A list of useful crate for testing, particularly :
debug_assert() is run only in debug mode and removed in production builds.
The crate static_assertions with the macro const_assert! test const functions-and data during compilation.
(shared by Riduidel)
Solution : box the iterator and give the proper lifetime in signature function :
pub fn values<'a>(&'a self) -> Box<Iterator<Item = &i32> + 'a> {
// ...
}Thanks a lot for this post; it is much clearer in my mind.
And the explanation for the prelude module.
reify (verb):to consider or represent (something abstract) as a material or concrete thing : to give definite content and form to (a concept or idea).
monomorphization is the term used in Rust.
About the classical couple heap/stack in rust, memory allocation, ... very instructive !
Good idea ! Blur all images that doesn't have a alt attribute.
img:not([alt]) {
filter: blur(5px);
}
Or you can set a `border: 5px solid red` too.
Feel free to highlight accessibility problems :)About asynchronous streams: default behavior is that it terminates earlier when an error is generated by the stream. How to close the stream before returning the error ?
Covering Rust syntax and most used concept as fast as possible : that's great !
-
Add code example in Rust in the examples/ directory located at the same level as src/.
-
Then run it with
cargo run --example code_sample.rs. -
Add specific dependencies used by the examples in the [dev-dependencies] of the Cargo.toml; these are not necessary to run the main programm