rust-lang / rustlings

:crab: Small exercises to get you used to reading and writing Rust code!
https://rustlings.cool
MIT License
52.69k stars 10.02k forks source link

`rustlings` crashes when `solutions/` doesn’t exist #2068

Closed mikeocool closed 1 month ago

mikeocool commented 1 month ago

Rustlings Version: 6.1.0

Repro Steps:

Result:

This came up for me, because after running rustlings init — I committed my progress, pushed the git repo create to a remote, and then cloned that repo it on another machine to continue working. solutions is included in the created .gitignore file, so it wasn’t present in the cloned repo — when attempting to run rustlings to continue, it crashed. Should solutions maybe just not be included in .gitignore, so that the directory gets committed?

mo8it commented 1 month ago

Fixed in https://github.com/rust-lang/rustlings/commit/97719fe8da82a91a1919e55e1950d0997acca574

BTW, Rustlings didn't crash in that case. It attempted to show an error message, but the error message was cleared away with the terminal clearing after showing the welcome message. Funny issue! Fixed in https://github.com/rust-lang/rustlings/commit/11fc3f1e56b1b248465039db4c736bb7186e4f47