diff options
| author | Eli Friedman <eli.friedman@gmail.com> | 2015-08-09 14:15:05 -0700 |
|---|---|---|
| committer | Eli Friedman <eli.friedman@gmail.com> | 2015-08-09 14:28:46 -0700 |
| commit | bbbfed2f93d3ba58a53ed8bf353ed11f3bb751db (patch) | |
| tree | 32e769e3502ad0a3b4e97681fac2b9569075f3af /src/doc/style/features | |
| parent | febdc3b201bcce1546c88e3be1b956d3f90d3059 (diff) | |
| download | rust-bbbfed2f93d3ba58a53ed8bf353ed11f3bb751db.tar.gz rust-bbbfed2f93d3ba58a53ed8bf353ed11f3bb751db.zip | |
Use https URLs to refer to rust-lang.org where appropriate.
Also fixes a few outdated links.
Diffstat (limited to 'src/doc/style/features')
| -rw-r--r-- | src/doc/style/features/functions-and-methods/input.md | 7 | ||||
| -rw-r--r-- | src/doc/style/features/modules.md | 20 |
2 files changed, 13 insertions, 14 deletions
diff --git a/src/doc/style/features/functions-and-methods/input.md b/src/doc/style/features/functions-and-methods/input.md index 072021194c1..8d123bcec6b 100644 --- a/src/doc/style/features/functions-and-methods/input.md +++ b/src/doc/style/features/functions-and-methods/input.md @@ -124,7 +124,7 @@ that the caller already owns, for example to re-use a buffer: fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> ``` -(From the [Reader trait](http://static.rust-lang.org/doc/master/std/io/trait.Reader.html#tymethod.read).) +(From the [Read trait](https://doc.rust-lang.org/stable/std/io/trait.Read.html#tymethod.read).) ### Consider validating arguments, statically or dynamically. [FIXME: needs RFC] @@ -132,7 +132,7 @@ _Note: this material is closely related to [library-level guarantees](../../safety/lib-guarantees.md)._ Rust APIs do _not_ generally follow the -[robustness principle](http://en.wikipedia.org/wiki/Robustness_principle): "be +[robustness principle](https://en.wikipedia.org/wiki/Robustness_principle): "be conservative in what you send; be liberal in what you accept". Instead, Rust code should _enforce_ the validity of input whenever practical. @@ -156,8 +156,7 @@ over fn foo(a: u8) { ... } ``` -Note that -[`ascii::Ascii`](http://static.rust-lang.org/doc/master/std/ascii/struct.Ascii.html) +Note that `ascii::Ascii` is a _wrapper_ around `u8` that guarantees the highest bit is zero; see [newtype patterns](../types/newtype.md) for more details on creating typesafe wrappers. diff --git a/src/doc/style/features/modules.md b/src/doc/style/features/modules.md index 04aae226f72..23d8760f571 100644 --- a/src/doc/style/features/modules.md +++ b/src/doc/style/features/modules.md @@ -58,13 +58,13 @@ For modules that themselves have submodules, place the module in a separate directory (e.g., `bar/mod.rs` for a module `bar`) rather than the same directory. Note the structure of -[`std::io`](http://doc.rust-lang.org/std/io/). Many of the submodules lack +[`std::io`](https://doc.rust-lang.org/std/io/). Many of the submodules lack children, like -[`io::fs`](http://doc.rust-lang.org/std/io/fs/) +[`io::fs`](https://doc.rust-lang.org/std/io/fs/) and -[`io::stdio`](http://doc.rust-lang.org/std/io/stdio/). +[`io::stdio`](https://doc.rust-lang.org/std/io/stdio/). On the other hand, -[`io::net`](http://doc.rust-lang.org/std/io/net/) +[`io::net`](https://doc.rust-lang.org/std/io/net/) contains submodules, so it lives in a separate directory: ``` @@ -88,7 +88,7 @@ submodules of `io::net` easier to find. ### Consider top-level definitions or reexports. [FIXME: needs RFC] For modules with submodules, -define or [reexport](http://doc.rust-lang.org/std/io/#reexports) commonly used +define or [reexport](https://doc.rust-lang.org/std/io/#reexports) commonly used definitions at the top level: * Functionality relevant to the module itself or to many of its @@ -98,10 +98,10 @@ definitions at the top level: common definitions. For example, -[`IoError`](http://doc.rust-lang.org/std/io/struct.IoError.html) +[`IoError`](https://doc.rust-lang.org/std/io/struct.IoError.html) is defined in `io/mod.rs`, since it pertains to the entirety of `io`, while -[`TcpStream`](http://doc.rust-lang.org/std/io/net/tcp/struct.TcpStream.html) +[`TcpStream`](https://doc.rust-lang.org/std/io/net/tcp/struct.TcpStream.html) is defined in `io/net/tcp.rs` and reexported in the `io` module. ### Use internal module hirearchies for organization. [FIXME: needs RFC] @@ -113,11 +113,11 @@ is defined in `io/net/tcp.rs` and reexported in the `io` module. Internal module hirearchies (i.e., private submodules) may be used to hide implementation details that are not part of the module's API. -For example, in [`std::io`](http://doc.rust-lang.org/std/io/), `mod mem` +For example, in [`std::io`](https://doc.rust-lang.org/std/io/), `mod mem` provides implementations for -[`BufReader`](http://doc.rust-lang.org/std/io/struct.BufReader.html) +[`BufReader`](https://doc.rust-lang.org/std/io/struct.BufReader.html) and -[`BufWriter`](http://doc.rust-lang.org/std/io/struct.BufWriter.html), +[`BufWriter`](https://doc.rust-lang.org/std/io/struct.BufWriter.html), but these are re-exported in `io/mod.rs` at the top level of the module: ```rust |
