Skip to content

Commit 8b24e75

Browse files
committed
---
yaml --- r: 148855 b: refs/heads/try2 c: 6132f7f h: refs/heads/master i: 148853: 8868ad9 148851: 1d4f3b6 148847: 9941993 v: v3
1 parent 2f0b785 commit 8b24e75

File tree

8 files changed

+496
-417
lines changed

8 files changed

+496
-417
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: e0f0a2f67f6bb66626bb3b7624e7bdb0198a1c47
8+
refs/heads/try2: 6132f7f6660c29fe3fc02422b7047246033db84f
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/librustdoc/html/escape.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use std::fmt;
2020
pub struct Escape<'a>(&'a str);
2121

2222
impl<'a> fmt::Show for Escape<'a> {
23-
fn fmt(s: &Escape<'a>, fmt: &mut fmt::Formatter) {
23+
fn fmt(s: &Escape<'a>, fmt: &mut fmt::Formatter) -> fmt::Result {
2424
// Because the internet is always right, turns out there's not that many
2525
// characters to escape: http://stackoverflow.com/questions/7381974
2626
let Escape(s) = *s;
@@ -29,7 +29,7 @@ impl<'a> fmt::Show for Escape<'a> {
2929
for (i, ch) in s.bytes().enumerate() {
3030
match ch as char {
3131
'<' | '>' | '&' | '\'' | '"' => {
32-
fmt.buf.write(pile_o_bits.slice(last, i).as_bytes());
32+
if_ok!(fmt.buf.write(pile_o_bits.slice(last, i).as_bytes()));
3333
let s = match ch as char {
3434
'>' => "&gt;",
3535
'<' => "&lt;",
@@ -38,15 +38,16 @@ impl<'a> fmt::Show for Escape<'a> {
3838
'"' => "&quot;",
3939
_ => unreachable!()
4040
};
41-
fmt.buf.write(s.as_bytes());
41+
if_ok!(fmt.buf.write(s.as_bytes()));
4242
last = i + 1;
4343
}
4444
_ => {}
4545
}
4646
}
4747

4848
if last < s.len() {
49-
fmt.buf.write(pile_o_bits.slice_from(last).as_bytes());
49+
if_ok!(fmt.buf.write(pile_o_bits.slice_from(last).as_bytes()));
5050
}
51+
Ok(())
5152
}
5253
}

0 commit comments

Comments
 (0)