Skip to content

Commit 74e38d8

Browse files
author
Jorge Aparicio
committed
---
yaml --- r: 163325 b: refs/heads/snap-stage3 c: 888f249 h: refs/heads/master i: 163323: f5785af v: v3
1 parent aa4f0ee commit 74e38d8

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 9146a919b616e39e528e4d7100d16eef52f1f852
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 0676c3bf0315b7cb5dd309435b6c5ead5bf2bc2f
4+
refs/heads/snap-stage3: 888f24969fc06d9aa783c71ab0d1f1b88a58f170
55
refs/heads/try: 20cbbffeefc1f35e2ea63afce7b42fbd79611d42
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/src/librustdoc/html/format.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,14 @@ fn resolved_path(w: &mut fmt::Formatter, did: ast::DefId, p: &clean::Path,
218218
})
219219
}
220220

221-
fn path(w: &mut fmt::Formatter, path: &clean::Path, print_all: bool,
222-
root: |&render::Cache, &[String]| -> Option<String>,
223-
info: |&render::Cache| -> Option<(Vec<String> , ItemType)>)
224-
-> fmt::Result
221+
fn path<F, G>(w: &mut fmt::Formatter,
222+
path: &clean::Path,
223+
print_all: bool,
224+
root: F,
225+
info: G)
226+
-> fmt::Result where
227+
F: FnOnce(&render::Cache, &[String]) -> Option<String>,
228+
G: FnOnce(&render::Cache) -> Option<(Vec<String>, ItemType)>,
225229
{
226230
// The generics will get written to both the title and link
227231
let mut generics = String::new();

branches/snap-stage3/src/librustdoc/html/render.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,9 @@ fn shortty(item: &clean::Item) -> ItemType {
646646
/// static HTML tree.
647647
// FIXME (#9639): The closure should deal with &[u8] instead of &str
648648
// FIXME (#9639): This is too conservative, rejecting non-UTF-8 paths
649-
fn clean_srcpath(src_root: &Path, src: &[u8], f: |&str|) {
649+
fn clean_srcpath<F>(src_root: &Path, src: &[u8], mut f: F) where
650+
F: FnMut(&str),
651+
{
650652
let p = Path::new(src);
651653

652654
// make it relative, if possible
@@ -1051,7 +1053,9 @@ impl<'a> Cache {
10511053
impl Context {
10521054
/// Recurse in the directory structure and change the "root path" to make
10531055
/// sure it always points to the top (relatively)
1054-
fn recurse<T>(&mut self, s: String, f: |&mut Context| -> T) -> T {
1056+
fn recurse<T, F>(&mut self, s: String, f: F) -> T where
1057+
F: FnOnce(&mut Context) -> T,
1058+
{
10551059
if s.len() == 0 {
10561060
panic!("Unexpected empty destination: {}", self.current);
10571061
}
@@ -1131,8 +1135,9 @@ impl Context {
11311135
/// all sub-items which need to be rendered.
11321136
///
11331137
/// The rendering driver uses this closure to queue up more work.
1134-
fn item(&mut self, item: clean::Item,
1135-
f: |&mut Context, clean::Item|) -> io::IoResult<()> {
1138+
fn item<F>(&mut self, item: clean::Item, mut f: F) -> io::IoResult<()> where
1139+
F: FnMut(&mut Context, clean::Item),
1140+
{
11361141
fn render(w: io::File, cx: &Context, it: &clean::Item,
11371142
pushname: bool) -> io::IoResult<()> {
11381143
info!("Rendering an item to {}", w.path().display());

0 commit comments

Comments
 (0)