File tree Expand file tree Collapse file tree 2 files changed +21
-25
lines changed Expand file tree Collapse file tree 2 files changed +21
-25
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
5
5
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
- refs/heads/try2: c02064d153dccb2d66c5158e0c7eeb6a8bbca0f5
8
+ refs/heads/try2: 936c07dcf0137b7ef456e82b9e70c3a2743dbe16
9
9
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
10
10
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
11
11
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
Original file line number Diff line number Diff line change @@ -156,31 +156,27 @@ impl FromBase64 for ~[u8] {
156
156
let ch = self[i] as char;
157
157
n <<= 6u;
158
158
159
- if ch >= 'A' && ch <= 'Z' {
160
- n |= (ch as uint) - 0x41u;
161
- } else if ch >= 'a' && ch <= 'z' {
162
- n |= (ch as uint) - 0x47u;
163
- } else if ch >= '0' && ch <= '9' {
164
- n |= (ch as uint) + 0x04u;
165
- } else if ch == '+' {
166
- n |= 0x3Eu;
167
- } else if ch == '/' {
168
- n |= 0x3Fu;
169
- } else if ch == '=' {
170
- match len - i {
171
- 1u => {
172
- r.push(((n >> 16u) & 0xFFu) as u8);
173
- r.push(((n >> 8u ) & 0xFFu) as u8);
174
- return copy r;
175
- }
176
- 2u => {
177
- r.push(((n >> 10u) & 0xFFu) as u8);
178
- return copy r;
179
- }
180
- _ => fail!(~" invalid base64 padding")
159
+ match ch {
160
+ 'A'..'Z' => n |= (ch as uint) - 0x41,
161
+ 'a'..'z' => n |= (ch as uint) - 0x47,
162
+ '0'..'9' => n |= (ch as uint) + 0x04,
163
+ '+' => n |= 0x3E,
164
+ '/' => n |= 0x3F,
165
+ '=' => {
166
+ match len - i {
167
+ 1u => {
168
+ r.push(((n >> 16u) & 0xFFu) as u8);
169
+ r.push(((n >> 8u ) & 0xFFu) as u8);
170
+ return copy r;
171
+ }
172
+ 2u => {
173
+ r.push(((n >> 10u) & 0xFFu) as u8);
174
+ return copy r;
175
+ }
176
+ _ => fail!(~" invalid base64 padding")
177
+ }
181
178
}
182
- } else {
183
- fail!(~" invalid base64 character");
179
+ _ => fail!(~" invalid base64 character")
184
180
}
185
181
186
182
i += 1u;
You can’t perform that action at this time.
0 commit comments