From 020e81e7fb88765764d2f0cc98d3ba271c354db0 Mon Sep 17 00:00:00 2001 From: Brad Anderson Date: Sat, 25 Feb 2017 01:32:03 -0600 Subject: [PATCH 1/5] Add error-chain links and slightly improve formatting --- README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ce9a474..62a9a47 100644 --- a/README.md +++ b/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,10 +49,10 @@ 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]. -# License +## License MIT/Apache-2.0 @@ -61,3 +61,5 @@ MIT/Apache-2.0 [byteorder-badge]: https://img.shields.io/crates/v/rustc-serialize.svg [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 From b46a78aa7c52fa04a3e2ac1cc0d5a5665307902d Mon Sep 17 00:00:00 2001 From: Brad Anderson Date: Sat, 25 Feb 2017 02:25:51 -0600 Subject: [PATCH 2/5] Add contribution guide skeleton --- CONTRIBUTING.md | 40 ++++++++++++++++++++++++++++++++++++++++ README.md | 2 ++ 2 files changed, 42 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..7704dae --- /dev/null +++ b/CONTRIBUTING.md @@ -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? diff --git a/README.md b/README.md index 62a9a47..5b98b91 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,8 @@ makes the `?` operator work 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 From 9ff05b43c5d6529441f4b2eb057cc9e7e6c73fd8 Mon Sep 17 00:00:00 2001 From: Brad Anderson Date: Sat, 25 Feb 2017 02:31:04 -0600 Subject: [PATCH 3/5] Fix contributing table of contents --- CONTRIBUTING.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7704dae..9e18f63 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -7,13 +7,13 @@ contributing to the project. If you think something in this document should chan 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](#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) From 46c755db03d19a37fef2a8a9a9405e9dfe0d302a Mon Sep 17 00:00:00 2001 From: Brad Anderson Date: Sat, 25 Feb 2017 02:34:02 -0600 Subject: [PATCH 4/5] Fix line breaks in contributing --- CONTRIBUTING.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9e18f63..f0744bd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,10 +19,10 @@ feel free propose a change in a pull request. 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 +TODO: Reporting bugs +TODO: Project page suggestions +TODO: Fixing bugs +TODO: Pull requests ## Crates TODO: How to add new crates to project @@ -32,9 +32,9 @@ TODO: Write about writing tests ## Style ### Git Commit Messages -https://chris.beams.io/posts/git-commit/ +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: Talk about writing good idiomatic code TODO: Maybe provide a template? From 74a0e0269d2a733f1075c91e9f0b06fec3abb50c Mon Sep 17 00:00:00 2001 From: Brad Anderson Date: Sat, 25 Feb 2017 02:47:26 -0600 Subject: [PATCH 5/5] Fix crate badge to have crate name --- README.md | 2 +- pages/byteorder.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5b98b91..1bff480 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,7 @@ MIT/Apache-2.0 -[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 diff --git a/pages/byteorder.md b/pages/byteorder.md index f8cbe66..d9e75fc 100644 --- a/pages/byteorder.md +++ b/pages/byteorder.md @@ -53,5 +53,5 @@ fn main() { run().unwrap() } -[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