Fix long lines

This commit is contained in:
Tim Chevalier 2012-09-25 19:12:50 -07:00
parent 7acf89c022
commit 473a866733
2 changed files with 5 additions and 4 deletions

View file

@ -101,8 +101,8 @@ pure fn to_either<T: Copy, U: Copy>(res: &Result<U, T>) -> Either<T, U> {
* ok(parse_bytes(buf))
* }
*/
fn chain<T, U: Copy, V: Copy>(+res: Result<T, V>, op: fn(+t: T) -> Result<U, V>)
-> Result<U, V> {
fn chain<T, U: Copy, V: Copy>(+res: Result<T, V>, op: fn(+t: T)
-> Result<U, V>) -> Result<U, V> {
// XXX: Should be writable with move + match
if res.is_ok() {
op(unwrap(res))
@ -309,7 +309,7 @@ fn map_opt<T,U:Copy,V:Copy>(
* to accommodate an error like the vectors being of different lengths.
*/
fn map_vec2<S,T,U:Copy,V:Copy>(ss: &[S], ts: &[T],
op: fn((&S),(&T)) -> Result<V,U>) -> Result<~[V],U> {
op: fn((&S),(&T)) -> Result<V,U>) -> Result<~[V],U> {
assert vec::same_length(ss, ts);
let n = vec::len(ts);

View file

@ -1048,7 +1048,8 @@ mod tests {
mk_dict(~[
(~"a", Null),
(~"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(~[
(~"a", Null),
(~"b", Boolean(true))]));