mirror of
https://github.com/rust-lang-nursery/rust-cookbook
synced 2024-11-21 19:13:07 +00:00
Merge branch 'master' of https://github.com/brson/rust-cookbook into develop
This commit is contained in:
commit
b0a38e3004
3 changed files with 52 additions and 8 deletions
40
CONTRIBUTING.md
Normal file
40
CONTRIBUTING.md
Normal file
|
@ -0,0 +1,40 @@
|
|||
# Contributing to the Rust Cookbook
|
||||
|
||||
Have something useful to add to the Rust Cookbook? We'd love to have it!
|
||||
|
||||
This document contains information and guidelines that you should read before
|
||||
contributing to the project. If you think something in this document should change,
|
||||
feel free propose a change in a pull request.
|
||||
|
||||
## Table of Contents
|
||||
* [Getting Started](#getting-started)
|
||||
* [How to Contribute](#how-to-contribute)
|
||||
* [Crates](#crates)
|
||||
* [Tests](#tests)
|
||||
* [Style](#style)
|
||||
* [Git Commit Messages](#git-commit-messages)
|
||||
* [Snippet Style](#snippet-style)
|
||||
|
||||
## Getting Started
|
||||
TODO: Mention Trello and how to join (if we keep using it)
|
||||
|
||||
## How to Contribute
|
||||
TODO: Reporting bugs
|
||||
TODO: Project page suggestions
|
||||
TODO: Fixing bugs
|
||||
TODO: Pull requests
|
||||
|
||||
## Crates
|
||||
TODO: How to add new crates to project
|
||||
|
||||
## Tests
|
||||
TODO: Write about writing tests
|
||||
|
||||
## Style
|
||||
### Git Commit Messages
|
||||
https://chris.beams.io/posts/git-commit/
|
||||
TODO: Possibly take relevant parts from this post or write our own
|
||||
|
||||
### Snippet Style
|
||||
TODO: Talk about writing good idiomatic code
|
||||
TODO: Maybe provide a template?
|
18
README.md
18
README.md
|
@ -2,15 +2,15 @@
|
|||
|
||||
A practical guide to the Rust crate ecosystem.
|
||||
|
||||
[Read and write integers in little-endian byte order](pages/byteorder.md)
|
||||
[![byteorder][byteorder-badge]][byteorder]
|
||||
## Recipes
|
||||
### [Byteorder](pages/byteorder.md) [![byteorder][byteorder-badge]][byteorder]
|
||||
|
||||
|
||||
# A note about error handling
|
||||
## A note about error handling
|
||||
|
||||
Error handling in Rust is robust when done correctly, but in today's
|
||||
Rust it requires a fair bit of boilerplate. Because of this one often
|
||||
seees Rust examples filled with `unwrap` calls instead of proper error
|
||||
sees Rust examples filled with `unwrap` calls instead of proper error
|
||||
handling.
|
||||
|
||||
Since these recipes are intended to be reused as-is and encourage best
|
||||
|
@ -49,15 +49,19 @@ and `Result` type, along with an automatic conversion from
|
|||
the common `::std::io::Error` type. The automatic conversion
|
||||
makes the `?` operator work
|
||||
|
||||
For more background on error handling in Rust, read TODO and TODO.
|
||||
For more background on error handling in Rust, read [this page of the Rust book][error-docs] and [this blog post][error-blog].
|
||||
|
||||
## Contributing
|
||||
If you'd like to make changes to the project, please see [this guide](CONTRIBUTING.md).
|
||||
|
||||
# License
|
||||
## License
|
||||
|
||||
MIT/Apache-2.0
|
||||
|
||||
|
||||
<!-- Links -->
|
||||
|
||||
[byteorder-badge]: https://img.shields.io/crates/v/rustc-serialize.svg
|
||||
[byteorder-badge]: https://img.shields.io/crates/v/rustc-serialize.svg?label=byteorder
|
||||
[byteorder]: https://docs.rs/byteorder
|
||||
[error-docs]: https://doc.rust-lang.org/book/error-handling.html
|
||||
[error-blog]: https://brson.github.io/2016/11/30/starting-with-error-chain
|
||||
|
|
|
@ -53,5 +53,5 @@ fn main() { run().unwrap() }
|
|||
|
||||
<!-- Links -->
|
||||
|
||||
[byteorder-badge]: https://img.shields.io/crates/v/rustc-serialize.svg
|
||||
[byteorder-badge]: https://img.shields.io/crates/v/rustc-serialize.svg?label=byteorder
|
||||
[byteorder]: https://docs.rs/byteorder
|
||||
|
|
Loading…
Reference in a new issue