Good write up on Rust fundamentals. I have a love-hate relationship with the current state.
I do love the idea of testing documentation examples.
I'm less than thrilled about some of the current tooling:
?
Result
compile_fail
There's other comment formats that can be helpful. For example, to write a multi-line module doc test:
/*! ## Tests here */
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Good write up on Rust fundamentals.
I have a love-hate relationship with the current state.
I do love the idea of testing documentation examples.
I'm less than thrilled about some of the current tooling:
?
/Result
is clumsycompile_fail
is useful to show correct ownership usage, but since you can't specify the failure type unrelated failures also cause the test to passThere's other comment formats that can be helpful. For example, to write a multi-line module doc test: