Fix long lines
This commit is contained in:
parent
7acf89c022
commit
473a866733
2 changed files with 5 additions and 4 deletions
|
@ -101,8 +101,8 @@ pure fn to_either<T: Copy, U: Copy>(res: &Result<U, T>) -> Either<T, U> {
|
||||||
* ok(parse_bytes(buf))
|
* ok(parse_bytes(buf))
|
||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
fn chain<T, U: Copy, V: Copy>(+res: Result<T, V>, op: fn(+t: T) -> Result<U, V>)
|
fn chain<T, U: Copy, V: Copy>(+res: Result<T, V>, op: fn(+t: T)
|
||||||
-> Result<U, V> {
|
-> Result<U, V>) -> Result<U, V> {
|
||||||
// XXX: Should be writable with move + match
|
// XXX: Should be writable with move + match
|
||||||
if res.is_ok() {
|
if res.is_ok() {
|
||||||
op(unwrap(res))
|
op(unwrap(res))
|
||||||
|
|
|
@ -1048,7 +1048,8 @@ mod tests {
|
||||||
mk_dict(~[
|
mk_dict(~[
|
||||||
(~"a", Null),
|
(~"a", Null),
|
||||||
(~"b", Boolean(true))]));
|
(~"b", Boolean(true))]));
|
||||||
assert eq(result::get(&from_str(~"\n{ \"a\": null, \"b\" : true }\n")),
|
assert eq(result::get(&from_str(
|
||||||
|
~"\n{ \"a\": null, \"b\" : true }\n")),
|
||||||
mk_dict(~[
|
mk_dict(~[
|
||||||
(~"a", Null),
|
(~"a", Null),
|
||||||
(~"b", Boolean(true))]));
|
(~"b", Boolean(true))]));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue