Skip to content

Commit

Permalink
Change static.rust-lang.org to doc.rust-lang.org
Browse files Browse the repository at this point in the history
The new documentation site has shorter urls, gzip'd content, and index.html
redirecting functionality.
  • Loading branch information
alexcrichton committed May 22, 2014
1 parent 1edb0e5 commit 799ddba
Show file tree
Hide file tree
Showing 40 changed files with 73 additions and 58 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

If you're just reporting a bug, please see:

http://static.rust-lang.org/doc/master/complement-bugreport.html
http://doc.rust-lang.org/complement-bugreport.html

## Pull request procedure

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ documentation.
> [getting started][wiki-start] notes on the wiki.
[installer]: http://www.rust-lang.org/install.html
[tutorial]: http://static.rust-lang.org/doc/tutorial.html
[tutorial]: http://doc.rust-lang.org/tutorial.html
[wiki-start]: https://github.com/mozilla/rust/wiki/Note-getting-started-developing-Rust
[win-wiki]: https://github.com/mozilla/rust/wiki/Using-Rust-on-Windows

Expand Down Expand Up @@ -60,7 +60,7 @@ documentation.

[repo]: https://github.com/mozilla/rust
[tarball]: http://static.rust-lang.org/dist/rust-nightly.tar.gz
[tutorial]: http://static.rust-lang.org/doc/master/tutorial.html
[tutorial]: http://doc.rust-lang.org/tutorial.html

## Notes

Expand Down
2 changes: 1 addition & 1 deletion mk/docs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ doc/footer.tex: $(D)/footer.inc | doc/
# HTML (rustdoc)
DOC_TARGETS += doc/not_found.html
doc/not_found.html: $(D)/not_found.md $(HTML_DEPS) | doc/
$(RUSTDOC) $(RUSTDOC_HTML_OPTS_NO_CSS) --markdown-css http://static.rust-lang.org/doc/master/rust.css $<
$(RUSTDOC) $(RUSTDOC_HTML_OPTS_NO_CSS) --markdown-css http://doc.rust-lang.org/rust.css $<

define DEF_DOC

Expand Down
40 changes: 28 additions & 12 deletions src/doc/complement-cheatsheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

**Int to string**

Use [`ToStr`](http://static.rust-lang.org/doc/master/std/to_str/trait.ToStr.html).
Use [`ToStr`](../std/to_str/trait.ToStr.html).

~~~
let x: int = 42;
Expand All @@ -13,7 +13,8 @@ let y: StrBuf = x.to_str().to_strbuf();

**String to int**

Use [`FromStr`](http://static.rust-lang.org/doc/master/std/from_str/trait.FromStr.html), and its helper function, [`from_str`](http://static.rust-lang.org/doc/master/std/from_str/fn.from_str.html).
Use [`FromStr`](../std/from_str/trait.FromStr.html), and its helper function,
[`from_str`](../std/from_str/fn.from_str.html).

~~~
let x: Option<int> = from_str("42");
Expand All @@ -34,7 +35,8 @@ let y: StrBuf = format_strbuf!("{:X}", x); // uppercase hexadecimal

**String to int, in non-base-10**

Use [`FromStrRadix`](http://static.rust-lang.org/doc/master/std/num/trait.FromStrRadix.html), and its helper function, [`from_str_radix`](http://static.rust-lang.org/doc/master/std/num/fn.from_str_radix.html).
Use [`FromStrRadix`](../std/num/trait.FromStrRadix.html), and its helper
function, [`from_str_radix`](../std/num/fn.from_str_radix.html).

~~~
use std::num;
Expand All @@ -45,7 +47,8 @@ let y: i64 = x.unwrap();

**Vector of Bytes to String**

To return a Borrowed String Slice (&str) use the str helper function [`from_utf8`](http://static.rust-lang.org/doc/master/std/str/fn.from_utf8.html).
To return a Borrowed String Slice (&str) use the str helper function
[`from_utf8`](../std/str/fn.from_utf8.html).

~~~
use std::str;
Expand All @@ -55,7 +58,8 @@ let x: Option<&str> = str::from_utf8(bytes);
let y: &str = x.unwrap();
~~~

To return an Owned String (StrBuf) use the str helper function [`from_utf8_owned`](http://static.rust-lang.org/doc/master/std/str/fn.from_utf8_owned.html).
To return an Owned String (StrBuf) use the str helper function
[`from_utf8_owned`](../std/str/fn.from_utf8_owned.html).

~~~
use std::str;
Expand All @@ -65,7 +69,10 @@ let x: Result<StrBuf,~[u8]> =
let y: StrBuf = x.unwrap();
~~~

To return a [`MaybeOwned`](http://static.rust-lang.org/doc/master/std/str/enum.MaybeOwned.html) use the str helper function [`from_utf8_lossy`](http://static.rust-lang.org/doc/master/std/str/fn.from_utf8_owned.html). This function also replaces non-valid utf-8 sequences with U+FFFD replacement character.
To return a [`MaybeOwned`](../std/str/enum.MaybeOwned.html) use the str helper
function [`from_utf8_lossy`](../std/str/fn.from_utf8_owned.html).
This function also replaces non-valid utf-8 sequences with U+FFFD replacement
character.

~~~
use std::str;
Expand All @@ -78,7 +85,13 @@ let y = str::from_utf8_lossy(x);

## How do I read from a file?

Use [`File::open`](http://static.rust-lang.org/doc/master/std/io/fs/struct.File.html#method.open) to create a [`File`](http://static.rust-lang.org/doc/master/std/io/fs/struct.File.html) struct, which implements the [`Reader`](http://static.rust-lang.org/doc/master/std/io/trait.Reader.html) trait.
Use
[`File::open`](../std/io/fs/struct.File.html#method.open)
to create a
[`File`](../std/io/fs/struct.File.html)
struct, which implements the
[`Reader`](../std/io/trait.Reader.html)
trait.

~~~ {.ignore}
use std::path::Path;
Expand All @@ -91,7 +104,7 @@ let reader : File = File::open(&path).unwrap_or_else(on_error);

## How do I iterate over the lines in a file?

Use the [`lines`](http://static.rust-lang.org/doc/master/std/io/trait.Buffer.html#method.lines) method on a [`BufferedReader`](http://static.rust-lang.org/doc/master/std/io/buffered/struct.BufferedReader.html).
Use the [`lines`](../std/io/trait.Buffer.html#method.lines) method on a [`BufferedReader`](../std/io/buffered/struct.BufferedReader.html).

~~~
use std::io::BufferedReader;
Expand All @@ -109,7 +122,7 @@ for line in reader.lines() {

## How do I search for a substring?

Use the [`find_str`](http://static.rust-lang.org/doc/master/std/str/trait.StrSlice.html#tymethod.find_str) method.
Use the [`find_str`](../std/str/trait.StrSlice.html#tymethod.find_str) method.

~~~
let str = "Hello, this is some random string";
Expand All @@ -120,7 +133,7 @@ let index: Option<uint> = str.find_str("rand");

## How do I get the length of a vector?

The [`Container`](http://static.rust-lang.org/doc/master/std/container/trait.Container.html) trait provides the `len` method.
The [`Container`](../std/container/trait.Container.html) trait provides the `len` method.

~~~
let u: ~[u32] = ~[0, 1, 2];
Expand All @@ -132,7 +145,7 @@ println!("u: {}, v: {}, w: {}", u.len(), v.len(), w.len()); // 3, 4, 5

## How do I iterate over a vector?

Use the [`iter`](http://static.rust-lang.org/doc/master/std/vec/trait.ImmutableVector.html#tymethod.iter) method.
Use the [`iter`](../std/vec/trait.ImmutableVector.html#tymethod.iter) method.

~~~
let values: ~[int] = ~[1, 2, 3, 4, 5];
Expand All @@ -141,7 +154,10 @@ for value in values.iter() { // value: &int
}
~~~

(See also [`mut_iter`](http://static.rust-lang.org/doc/master/std/vec/trait.MutableVector.html#tymethod.mut_iter) which yields `&mut int` and [`move_iter`](http://static.rust-lang.org/doc/master/std/vec/trait.OwnedVector.html#tymethod.move_iter) which yields `int` while consuming the `values` vector.)
(See also [`mut_iter`](../std/vec/trait.MutableVector.html#tymethod.mut_iter)
which yields `&mut int` and
[`move_iter`](../std/vec/trait.OwnedVector.html#tymethod.move_iter) which yields
`int` while consuming the `values` vector.)

# Type system

Expand Down
5 changes: 2 additions & 3 deletions src/doc/not_found.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ Some things that might be helpful to you though:

## Reference
* [The Rust official site](http://rust-lang.org)
* [The Rust reference manual](http://static.rust-lang.org/doc/master/rust.html) (* [PDF](http://static.rust-lang.org/doc/master/rust.pdf))
* [The Rust reference manual](http://doc.rust-lang.org/rust.html) (* [PDF](http://doc.rust-lang.org/rust.pdf))

## Docs
* [The standard library (stable)](http://doc.rust-lang.org/doc/0.10/std/index.html)
* [The standard library (master)](http://doc.rust-lang.org/doc/master/std/index.html)
* [The standard library](http://doc.rust-lang.org/std/)
2 changes: 1 addition & 1 deletion src/doc/rustdoc.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ documentation:
~~~
#[doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
html_root_url = "http://static.rust-lang.org/doc/master")];
html_root_url = "http://doc.rust-lang.org/")];
~~~

The `html_root_url` is the prefix that rustdoc will apply to any references to
Expand Down
10 changes: 5 additions & 5 deletions src/doc/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ let y: uint = x as uint;
assert!(y == 4u);
~~~~
[transmute]: http://static.rust-lang.org/doc/master/std/cast/fn.transmute.html
[transmute]: http://doc.rust-lang.org/std/mem/fn.transmute.html
## Syntax extensions
Expand All @@ -409,7 +409,7 @@ println!("what is this thing: {:?}", mystery_object);
~~~~
[pf]: http://en.cppreference.com/w/cpp/io/c/fprintf
[fmt]: http://static.rust-lang.org/doc/master/std/fmt/index.html
[fmt]: http://doc.rust-lang.org/std/fmt/
You can define your own syntax extensions with the macro system. For details,
see the [macro tutorial][macros]. Note that macro definition is currently
Expand Down Expand Up @@ -959,8 +959,8 @@ that are `Send`, but non-`Send` types can still *contain* types with custom
destructors. Example of types which are not `Send` are [`Gc<T>`][gc] and
[`Rc<T>`][rc], the shared-ownership types.

[gc]: http://static.rust-lang.org/doc/master/std/gc/struct.Gc.html
[rc]: http://static.rust-lang.org/doc/master/std/rc/struct.Rc.html
[gc]: http://doc.rust-lang.org/std/gc/struct.Gc.html
[rc]: http://doc.rust-lang.org/std/rc/struct.Rc.html

# Implementing a linked list

Expand Down Expand Up @@ -1486,7 +1486,7 @@ let mut x = 5;
# x = 3;
~~~~

[refcell]: http://static.rust-lang.org/doc/master/std/cell/struct.RefCell.html
[refcell]: http://doc.rust-lang.org/std/cell/struct.RefCell.html

# Dereferencing pointers

Expand Down
2 changes: 1 addition & 1 deletion src/liballoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
#![crate_type = "rlib"]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
html_root_url = "http://static.rust-lang.org/doc/master")]
html_root_url = "http://doc.rust-lang.org/")]

#![no_std]
#![feature(phase)]
Expand Down
2 changes: 1 addition & 1 deletion src/libarena/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#![license = "MIT/ASL2"]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
html_root_url = "http://static.rust-lang.org/doc/master")]
html_root_url = "http://doc.rust-lang.org/")]
#![allow(missing_doc)]

extern crate collections;
Expand Down
2 changes: 1 addition & 1 deletion src/libcollections/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#![license = "MIT/ASL2"]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
html_root_url = "http://static.rust-lang.org/doc/master")]
html_root_url = "http://doc.rust-lang.org/")]

#![feature(macro_rules, managed_boxes, default_type_params, phase)]

Expand Down
2 changes: 1 addition & 1 deletion src/libcore/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ This `for` loop syntax can be applied to any iterator over any type.
## Iteration protocol and more
More detailed information about iterators can be found in the [container
guide](http://static.rust-lang.org/doc/master/guide-container.html) with
guide](http://doc.rust-lang.org/guide-container.html) with
the rest of the rust manuals.
*/
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#![crate_type = "rlib"]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
html_root_url = "http://static.rust-lang.org/doc/master")]
html_root_url = "http://doc.rust-lang.org/")]

#![no_std]
#![feature(globs, macro_rules, managed_boxes, phase)]
Expand Down
2 changes: 1 addition & 1 deletion src/libflate/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Simple [DEFLATE][def]-based compression. This is a wrapper around the
#![license = "MIT/ASL2"]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
html_root_url = "http://static.rust-lang.org/doc/master")]
html_root_url = "http://doc.rust-lang.org/")]
#![feature(phase)]
#![deny(deprecated_owned_vector)]

Expand Down
2 changes: 1 addition & 1 deletion src/libfourcc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fn main() {
#![license = "MIT/ASL2"]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
html_root_url = "http://static.rust-lang.org/doc/master")]
html_root_url = "http://doc.rust-lang.org/")]

#![deny(deprecated_owned_vector)]
#![feature(macro_registrar, managed_boxes)]
Expand Down
2 changes: 1 addition & 1 deletion src/libgetopts/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
#![license = "MIT/ASL2"]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
html_root_url = "http://static.rust-lang.org/doc/master")]
html_root_url = "http://doc.rust-lang.org/")]
#![feature(globs, phase)]
#![deny(missing_doc)]
#![deny(deprecated_owned_vector)]
Expand Down
2 changes: 1 addition & 1 deletion src/libglob/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#![license = "MIT/ASL2"]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
html_root_url = "http://static.rust-lang.org/doc/master")]
html_root_url = "http://doc.rust-lang.org/")]

#![deny(deprecated_owned_vector)]

Expand Down
2 changes: 1 addition & 1 deletion src/libgraphviz/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ pub fn main() {
#![license = "MIT/ASL2"]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
html_root_url = "http://static.rust-lang.org/doc/master")]
html_root_url = "http://doc.rust-lang.org/")]

#![experimental]

Expand Down
2 changes: 1 addition & 1 deletion src/libgreen/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
#![crate_type = "dylib"]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
html_root_url = "http://static.rust-lang.org/doc/master")]
html_root_url = "http://doc.rust-lang.org/")]

// NB this does *not* include globs, please keep it that way.
#![feature(macro_rules, phase)]
Expand Down
2 changes: 1 addition & 1 deletion src/libhexfloat/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ fn main() {
#![license = "MIT/ASL2"]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
html_root_url = "http://static.rust-lang.org/doc/master")]
html_root_url = "http://doc.rust-lang.org/")]

#![deny(deprecated_owned_vector)]
#![feature(macro_registrar, managed_boxes)]
Expand Down
2 changes: 1 addition & 1 deletion src/liblog/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ if logging is disabled, none of the components of the log will be executed.
#![crate_type = "dylib"]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
html_root_url = "http://static.rust-lang.org/doc/master")]
html_root_url = "http://doc.rust-lang.org/")]

#![feature(macro_rules)]
#![deny(missing_doc, deprecated_owned_vector)]
Expand Down
2 changes: 1 addition & 1 deletion src/libnative/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#![crate_type = "dylib"]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
html_root_url = "http://static.rust-lang.org/doc/master")]
html_root_url = "http://doc.rust-lang.org/")]
#![deny(unused_result, unused_must_use)]
#![allow(non_camel_case_types)]
#![feature(macro_rules)]
Expand Down
2 changes: 1 addition & 1 deletion src/libnum/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#![license = "MIT/ASL2"]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
html_root_url = "http://static.rust-lang.org/doc/master")]
html_root_url = "http://doc.rust-lang.org/")]

#![deny(deprecated_owned_vector)]

Expand Down
2 changes: 1 addition & 1 deletion src/librand/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ println!("{:?}", tuple_ptr)
#![crate_type = "rlib"]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk.png",
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
html_root_url = "http://static.rust-lang.org/doc/master")]
html_root_url = "http://doc.rust-lang.org/")]

#![feature(macro_rules, managed_boxes, phase)]
#![deny(deprecated_owned_vector)]
Expand Down
2 changes: 1 addition & 1 deletion src/libregex/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@
#![license = "MIT/ASL2"]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
html_root_url = "http://static.rust-lang.org/doc/master")]
html_root_url = "http://doc.rust-lang.org/")]

#![feature(macro_rules, phase)]
#![deny(missing_doc, deprecated_owned_vector)]
Expand Down
2 changes: 1 addition & 1 deletion src/libregex_macros/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#![license = "MIT/ASL2"]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
html_root_url = "http://static.rust-lang.org/doc/master")]
html_root_url = "http://doc.rust-lang.org/")]

#![feature(macro_registrar, managed_boxes, quote)]

Expand Down
2 changes: 1 addition & 1 deletion src/librlibc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#![crate_type = "rlib"]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
html_root_url = "http://static.rust-lang.org/doc/master")]
html_root_url = "http://doc.rust-lang.org/")]

#![no_std]
#![experimental]
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/driver/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub fn main_args(args: &[StrBuf]) -> int {
}

static BUG_REPORT_URL: &'static str =
"http://static.rust-lang.org/doc/master/complement-bugreport.html";
"http://doc.rust-lang.org/complement-bugreport.html";

fn run_compiler(args: &[StrBuf]) {
let matches = match handle_options(Vec::from_slice(args)) {
Expand Down
Loading

0 comments on commit 799ddba

Please sign in to comment.