summaryrefslogtreecommitdiff
path: root/exercises
AgeCommit message (Collapse)Author
2022-02-04Merge pull request #733 from apogeeoak/introdiannasoreil
feat(intro): Proposal to add successfully compiling exercise as the first exercise.
2022-02-04Merge pull request #728 from Zerotask/improve-option-further-informationdiannasoreil
docs(option): improve further information if let and while let
2022-02-04fix(structs3): Add a hint for panic (#608)Yang Wen
as a totally newbie to Rust, I don't know panic statement from https://doc.rust-lang.org/book/ and rustlings in the beginning. After a hard searching of [should_panic], then I figure out panic statement. So it's helpful to tell the learner that write a panic statement here.
2022-02-04fix(errors1): Add a comment to make the purpose more clear (#486)zydxhs
Signed-off-by: zydxhs <johnsmithcry@163.com>
2021-12-29fix(quiz1): update to say quiz covers "If"ZX
2021-12-15fix(clippy1): Updated code to test correctness clippy lint with ↵Franklin van Nes
approx_constant lint rule closes #888
2021-10-30fix(structs3.rs): assigned value to cents_per_gram in testMichael Walsh
Intended to simplify the lesson by removing the need to figure out what the value is meant to be based on the tests. Previous commits (https://github.com/rust-lang/rustlings/commit/9ca08b8f2b09366e97896a4a8cf9ff3bb4d54380 and https://github.com/rust-lang/rustlings/commit/114b54cbdb977234b39e5f180d937c14c78bb8b2#diff-ce1c232ff0ddaff909351bb84cb5bff423b5b9e04f21fd4db7ffe443e598e174) removed the mathematical complexity, and I feel this addition is a needed change to further streamline the exercise.
2021-10-18fix(traits1): rename test functions to snake case (#854)xuesong
Co-authored-by: zhangshaozhi <zhangshaozhi@ZhangshaozhideMacBook-Pro.local>
2021-09-30fix(move_semantics5): correct typo (#857)Fredrik Enestad
2021-09-27fix(structs3): remove redundant 'return' (#852)Zhenghao Lu
2021-09-25Merge pull request #781 from tlyu/advanced-errsdiannasoriel
feature: advanced errors
2021-09-25feat: add advanced_errs2Taylor Yu
New exercise to demonstrate traits that make it easier for other code to consume our custom error types.
2021-09-25feat: add advanced_errs1Taylor Yu
New section and exercise to demonstrate the `From` trait for errors and its usefulness with the `?` operator.
2021-09-25fix(move_semantics5): change &mut *y to &mut x (#814)frogtd
Instead of having to explain why ```rs let mut x = 100; let y = &mut x; let mut z_owned = *y; let z = &mut z_owned; *y += 100; *z += 1000; ``` and ```rs let mut x = 100; let y = &mut x; let z = &mut *y; *y += 100; *z += 1000; ``` are different, you still get the point across about having only one mutable reference. As it stands, this exercise does too much (dereferencing and having only one mutable reference), and by doing so confuses people. Example of someone being confused by this: <https://discord.com/channels/273534239310479360/273541522815713281/872689531428692040>
2021-09-21feat(quiz1): add default function name in comment (#838)Weilet
2021-09-06fix(modules2): fix typo (#835)granddaifuku
2021-09-03feat(modules): update exercises, add modules3 (#822)anuk909
Co-authored-by: diannasoriel <mokou@fastmail.com>
2021-08-26chore(quiz1): revert wordingdiannasoriel
2021-08-24fix(quiz1): Fix inconsistent wording (#826)Damian
The second test expects the function to return 80 when there is an order of 40 apples, but the current wording implies returning 40 will pass as well
2021-07-29fix(move_semantics5): Clarify instructionsana
2021-07-09Merge pull request #732 from apogeeoak/iterators5fmoko
chore(iterators5): Minor formatting improvements.
2021-07-08Merge pull request #737 from ghost/correct-small-typofmoko
Correct small typo in exercises/conversions/from_str.rs
2021-07-07fix(quiz1): Updated question description (#794)Rakshit Sinha
Co-authored-by: Rakshit Sinha <rakshit.sinha@oracle.com>
2021-07-06docs: Update collections README with HashMap linklauralindzey
2021-07-05docs: Update exercise to chapter mapping for HashMapLaura Lindzey
2021-06-24fix(from_str, try_from_into): custom error typesTaylor Yu
Remove the use of trait objects as errors from `from_str` and `try_from_into`; they seem to have caused a lot of confusion in practice. (Also, it's considered best practice to use custom error types instead of boxed errors in library code.) Instead, use custom error enums, and update hints accordingly. Hints also provide some guidance about converting errors, which could be covered more completely in a future advanced errors section. Also move from_str to directly after the similar exercise `from_into`, for the sake of familiarity when solving.
2021-06-24Merge pull request #771 from tlyu/iterators5-trait-tweakmarisa
fix(iterators5): derive Clone, Copy
2021-06-24Merge pull request #772 from tlyu/errors-reworkmarisa
feature: improve error_handling exercises
2021-06-09address review feedbackTaylor Yu
Adjust error text and naming to conform with best practices. Use `map_err()` instead of `or()`. Wrap lower-level errors instead of ignoring their details. Also, don't "cheat" by bypassing the `new()` function in tests. Fix a dangling reference in the try_from_into hints.
2021-06-07fix(variables5): confine the answer furtherZC
let mut number = 3; can lead to a correct answer, so the comment helps to direct the users to the intended answer.
2021-06-06feature: improve error_handling exercisesTaylor Yu
Add new exercises errors5 and errors6, to introduce boxed errors and custom error enums more gently. Delete errorsn, because it tried to do too much too soon.
2021-06-06fix: rename result1 to errors4Taylor Yu
Also put it in the ERROR HANDLING section where it probably belongs.
2021-06-06fix(iterators5): derive Clone, CopyTaylor Yu
To allow more flexibility in solutions, derive `Clone` and `Copy` for `Progress`.
2021-05-22fix: move_semantics5 hintsTaylor Yu
Improve the hints for move_semantics5, as well as the explanatory comments in the code. Previously, it was not clear what possible changes were allowed. It seems that reordering the statements might be the intended solution. The previous comment about not "adding newlines" doesn't make sense, so treating it as "adding new lines" makes it more clear.
2021-05-17feat: Add move_semantics5 exercise. (#746)Sateesh
* feat: Add move_semantics5 exercise. * feat: Add option3 exercise * Address review comments. Fix typos, sentence formatting. * Remove unwanted newline. * Address review comments: make comment inline, fix format in print.
2021-05-12fix: remove trailing whitespaces from iterators1Juan Pablo Ramirez
2021-05-11fix: add hints to generics1 and generics2 exercisesJuan Pablo Ramirez
2021-05-09fix: remove trailing whitespaceJuan Pablo Ramirez
2021-04-29style(standard_library_types): stray line breakPi Delport
2021-04-27fix: Correct small typo in exercises/conversions/from_str.rsMartin HART
2021-04-26fix(intro1): Add compiler error explanation.apogeeoak
2021-04-25chore: Update quiz1.rs add explicit test for 40Maarten Tibau
2021-04-24feat(intro): Add intro section.apogeeoak
2021-04-24chore(iterators5): Minor formatting improvements.apogeeoak
2021-04-24docs(option): improve further informationZerotask
2021-04-23docs(exercises): updated all exercises readme filesZerotask
all exercises readme files now have a unified structure and a description
2021-04-23Merge pull request #721 from Zerotask/add-further-help-for-generics3marisa
docs(generics): add bounds help
2021-04-22docs(generics): add bounds helpZerotask
add help for bounds provided by the rust by example book
2021-04-22docs(errors): add additional help for Result/BoxingZerotask
add additional help information provided by the rust by example book
2021-04-21feat(arc1): Add more details to description and hint (#710)Brandon Macer
Co-authored-by: bmacer <bmacer@cisco.com> Co-authored-by: marisa <mokou@fastmail.com> Co-authored-by: Roberto Vidal <vidal.roberto.j@gmail.com>