From 19cb2a77076657063768e6db342a38933f0ba874 Mon Sep 17 00:00:00 2001 From: David Campbell Date: Sat, 14 Feb 2015 14:17:03 -0500 Subject: [PATCH 1/6] add newline before list in functions-and-methods The current version of hoedown treats lists interrupting paragraphs in the Markdown.pl style rather than CommonMark, so a newline is needed for the list to be rendered properly. --- src/doc/style/features/functions-and-methods/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/doc/style/features/functions-and-methods/README.md b/src/doc/style/features/functions-and-methods/README.md index 2dcfc382d0b..611cd564cca 100644 --- a/src/doc/style/features/functions-and-methods/README.md +++ b/src/doc/style/features/functions-and-methods/README.md @@ -20,6 +20,7 @@ for any operation that is clearly associated with a particular type. Methods have numerous advantages over functions: + * They do not need to be imported or qualified to be used: all you need is a value of the appropriate type. * Their invocation performs autoborrowing (including mutable borrows). From 06706510cbb0035b713a32c17291742c8090d9eb Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Sat, 21 Feb 2015 10:53:42 -0500 Subject: [PATCH 2/6] Make adjancent code examples more similar --- src/doc/style/features/let.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/doc/style/features/let.md b/src/doc/style/features/let.md index f13a84f6fee..6f423c6de8e 100644 --- a/src/doc/style/features/let.md +++ b/src/doc/style/features/let.md @@ -61,8 +61,8 @@ conditional expression. Prefer ```rust -s.iter().map(|x| x * 2) - .collect::>() +let v = s.iter().map(|x| x * 2) + .collect::>(); ``` over From 4d90b4d9b8ba4275be9031bf19c49f90c33c9823 Mon Sep 17 00:00:00 2001 From: David Campbell Date: Mon, 30 Mar 2015 18:31:42 -0400 Subject: [PATCH 3/6] Update let.md -- follow whitespace style guideline "Idiomatic code should not use extra whitespace in the middle of a line to provide alignment." --- src/doc/style/features/let.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/style/features/let.md b/src/doc/style/features/let.md index 6f423c6de8e..4a0bf4353b9 100644 --- a/src/doc/style/features/let.md +++ b/src/doc/style/features/let.md @@ -34,7 +34,7 @@ Prefer ```rust let foo = match bar { - Baz => 0, + Baz => 0, Quux => 1 }; ``` From 31a007af1964891ef820b10c6a8d3e667fbca1ae Mon Sep 17 00:00:00 2001 From: David Campbell Date: Mon, 30 Mar 2015 18:35:17 -0400 Subject: [PATCH 4/6] remove extra space from "over" code as well --- src/doc/style/features/let.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/style/features/let.md b/src/doc/style/features/let.md index 4a0bf4353b9..01dff3dccea 100644 --- a/src/doc/style/features/let.md +++ b/src/doc/style/features/let.md @@ -44,7 +44,7 @@ over ```rust let foo; match bar { - Baz => { + Baz => { foo = 0; } Quux => { From d0744ba3e7b60a25837af8350b3af7ef1d2b4548 Mon Sep 17 00:00:00 2001 From: Nils Liberg Date: Sat, 23 May 2015 11:19:11 +0200 Subject: [PATCH 5/6] Fix mistake: "to to" -> "to" --- src/doc/style/ownership/builders.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/style/ownership/builders.md b/src/doc/style/ownership/builders.md index 54992341ce5..348be516e37 100644 --- a/src/doc/style/ownership/builders.md +++ b/src/doc/style/ownership/builders.md @@ -16,7 +16,7 @@ If `T` is such a data structure, consider introducing a `T` _builder_: value. When possible, choose a better name: e.g. `Command` is the builder for `Process`. 2. The builder constructor should take as parameters only the data _required_ to - to make a `T`. + make a `T`. 3. The builder should offer a suite of convenient methods for configuration, including setting up compound inputs (like slices) incrementally. These methods should return `self` to allow chaining. From adac861db28b79f52455b1fd3121cd1964d0aceb Mon Sep 17 00:00:00 2001 From: Nils Liberg Date: Sat, 23 May 2015 17:31:57 +0200 Subject: [PATCH 6/6] Fix link to newtypes page --- src/doc/style/features/functions-and-methods/input.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doc/style/features/functions-and-methods/input.md b/src/doc/style/features/functions-and-methods/input.md index a1310de2e60..072021194c1 100644 --- a/src/doc/style/features/functions-and-methods/input.md +++ b/src/doc/style/features/functions-and-methods/input.md @@ -159,7 +159,7 @@ fn foo(a: u8) { ... } Note that [`ascii::Ascii`](http://static.rust-lang.org/doc/master/std/ascii/struct.Ascii.html) is a _wrapper_ around `u8` that guarantees the highest bit is zero; see -[newtype patterns]() for more details on creating typesafe wrappers. +[newtype patterns](../types/newtype.md) for more details on creating typesafe wrappers. Static enforcement usually comes at little run-time cost: it pushes the costs to the boundaries (e.g. when a `u8` is first converted into an