A repository for completing this issue on mozilla/rust. This repository contains minimal working code for many simple (and not so simple) tasks. New contributors and learners of the language are welcome. We will try to work with you to make the code more idiomatic over time.
Working on a problem, need some help? Drop by #rust-rosetta on irc.mozilla.org.
All tasks that have been completed are listed (along with a link to the problem) in Cargo.toml
Looking to help out? Great, thanks! We have a few guidelines:
- The code you contribute is public domain.
- Your code should build cleanly latest nightly provided by
rustup.sh
- Keep your code as simple as possible, please avoid Dead Code warnings.
- Don't be afraid of comments, the code is going to be written once, read hundreds of times, and maintained until past the 1.0 release of Rust.
- Include a link to the Rosetta Code Problem at the top of the code sample.
- Add a line to the
Cargo.toml
below. (It's alphabetical!)
The top of your code should look like this:
// https://rosettacode.org/wiki/foo
If you'd like, you're welcome to add your contact details, name, or other information as well.
Then add the entry in lexiographical ordering into Cargo.toml
like this:
[[bin]]
# https://rosettacode.org/wiki/Hailstone_sequence
name = "hailstone"
path = "src/hailstone.rs"
Here's an idea of what a workflow would look like (in general-ish):
If it's your first time
- Choose a problem off Rosetta Code.
- Fork this repo on Github. (Help here!)
- Clone your resulting repo onto your machine.
- When you contribute your first pull request, include yourself in the authors of the
Cargo.toml
!
Every other time
- Navigate to your
rust-rosetta
directory. - Make sure you're on
master
branch. - Update your fork (Details)
- Create a branch that is reasonably unique:
git branch hoverbear-hailstone
- Make your changes for this problem.
- Add the new definition to the
Cargo.toml
- Add one code file with the appropriate name to the
src/
directory. If you need any data there is a separate folder for that. - Make sure to include unit tests for us, and comments! :)
- Add the new definition to the
- Check
git status
to make sure you don't mangle anything else. - Commit your changes
git commit -a -m "Implement blah blah blah"
- Submit a Pull request here.
After it's accepted
- Delete the branch.
If this is unclear or you're having difficulties, just open an issue, we'd love to help.