diff --git a/src/libcore/ctypes.rs b/src/libcore/ctypes.rs index f928f5d1863..824cef878d9 100644 --- a/src/libcore/ctypes.rs +++ b/src/libcore/ctypes.rs @@ -75,9 +75,9 @@ type uint32_t = u32; enum void { // Making the only variant reference itself makes it impossible to // construct. Not exporting it makes it impossible to destructure. - void_private(@void); + void_private(@void), // FIXME: #881 - void_private2(@void); + void_private2(@void), } #[doc( diff --git a/src/libcore/extfmt.rs b/src/libcore/extfmt.rs index 8a69a3c8070..61b6ec3c1b4 100644 --- a/src/libcore/extfmt.rs +++ b/src/libcore/extfmt.rs @@ -39,32 +39,32 @@ import option::{some, none}; // Functions used by the fmt extension at compile time mod ct { - enum signedness { signed; unsigned; } - enum caseness { case_upper; case_lower; } + enum signedness { signed, unsigned, } + enum caseness { case_upper, case_lower, } enum ty { - ty_bool; - ty_str; - ty_char; - ty_int(signedness); - ty_bits; - ty_hex(caseness); - ty_octal; - ty_float; - ty_poly; + ty_bool, + ty_str, + ty_char, + ty_int(signedness), + ty_bits, + ty_hex(caseness), + ty_octal, + ty_float, + ty_poly, // FIXME: More types } enum flag { - flag_left_justify; - flag_left_zero_pad; - flag_space_for_sign; - flag_sign_always; - flag_alternate; + flag_left_justify, + flag_left_zero_pad, + flag_space_for_sign, + flag_sign_always, + flag_alternate, } enum count { - count_is(int); - count_is_param(int); - count_is_next_param; - count_implied; + count_is(int), + count_is_param(int), + count_is_next_param, + count_implied, } // A formatted conversion from an expression to a string @@ -77,7 +77,7 @@ mod ct { // A fragment of the output sequence - enum piece { piece_string(str); piece_conv(conv); } + enum piece { piece_string(str), piece_conv(conv), } type error_fn = fn@(str) -> ! ; fn parse_fmt_string(s: str, error: error_fn) -> [piece] { @@ -264,20 +264,20 @@ mod ct { // implement it this way, I think. mod rt { enum flag { - flag_left_justify; - flag_left_zero_pad; - flag_space_for_sign; - flag_sign_always; - flag_alternate; + flag_left_justify, + flag_left_zero_pad, + flag_space_for_sign, + flag_sign_always, + flag_alternate, // FIXME: This is a hack to avoid creating 0-length vec exprs, // which have some difficulty typechecking currently. See // comments in front::extfmt::make_flags - flag_none; + flag_none, } - enum count { count_is(int); count_implied; } - enum ty { ty_default; ty_bits; ty_hex_upper; ty_hex_lower; ty_octal; } + enum count { count_is(int), count_implied, } + enum ty { ty_default, ty_bits, ty_hex_upper, ty_hex_lower, ty_octal, } // FIXME: May not want to use a vector here for flags; // instead just use a bool per flag @@ -391,7 +391,7 @@ mod rt { ret str::unsafe_from_bytes(svec); } - enum pad_mode { pad_signed; pad_unsigned; pad_nozero; } + enum pad_mode { pad_signed, pad_unsigned, pad_nozero, } fn pad(cv: conv, s: str, mode: pad_mode) -> str { let uwidth; alt cv.width { diff --git a/src/libcore/option.rs b/src/libcore/option.rs index d45bda93dbb..8cba1c84dc0 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -14,9 +14,9 @@ The option type */ enum t { /* Variant: none */ - none; + none, /* Variant: some */ - some(T); + some(T), } /* Section: Operations */ diff --git a/src/libcore/task.rs b/src/libcore/task.rs index a1ed59d3e43..b5642515953 100644 --- a/src/libcore/task.rs +++ b/src/libcore/task.rs @@ -181,9 +181,9 @@ Indicates the manner in which a task exited */ enum task_result { /* Variant: tr_success */ - tr_success; + tr_success, /* Variant: tr_failure */ - tr_failure; + tr_failure, } /* @@ -193,7 +193,7 @@ Message sent upon task exit to indicate normal or abnormal termination */ enum task_notification { /* Variant: exit */ - exit(task, task_result); + exit(task, task_result), } /* diff --git a/src/libstd/deque.rs b/src/libstd/deque.rs index b5f46732cfc..5ab9a44cd1a 100644 --- a/src/libstd/deque.rs +++ b/src/libstd/deque.rs @@ -241,10 +241,10 @@ mod tests { assert (e(deq.get(3), d)); } - enum taggy { one(int); two(int, int); three(int, int, int); } + enum taggy { one(int), two(int, int), three(int, int, int), } enum taggypar { - onepar(int); twopar(int, int); threepar(int, int, int); + onepar(int), twopar(int, int), threepar(int, int, int), } type reccy = {x: int, y: int, t: taggy}; diff --git a/src/libstd/extfmt.rs b/src/libstd/extfmt.rs index 441ff01a3c1..a34c1d27f96 100644 --- a/src/libstd/extfmt.rs +++ b/src/libstd/extfmt.rs @@ -39,31 +39,31 @@ import option::{some, none}; // Functions used by the fmt extension at compile time mod ct { - enum signedness { signed; unsigned; } - enum caseness { case_upper; case_lower; } + enum signedness { signed, unsigned, } + enum caseness { case_upper, case_lower, } enum ty { - ty_bool; - ty_str; - ty_char; - ty_int(signedness); - ty_bits; - ty_hex(caseness); - ty_octal; - ty_float; + ty_bool, + ty_str, + ty_char, + ty_int(signedness), + ty_bits, + ty_hex(caseness), + ty_octal, + ty_float, // FIXME: More types } enum flag { - flag_left_justify; - flag_left_zero_pad; - flag_space_for_sign; - flag_sign_always; - flag_alternate; + flag_left_justify, + flag_left_zero_pad, + flag_space_for_sign, + flag_sign_always, + flag_alternate, } enum count { - count_is(int); - count_is_param(int); - count_is_next_param; - count_implied; + count_is(int), + count_is_param(int), + count_is_next_param, + count_implied, } // A formatted conversion from an expression to a string @@ -76,7 +76,7 @@ mod ct { // A fragment of the output sequence - enum piece { piece_string(str); piece_conv(conv); } + enum piece { piece_string(str), piece_conv(conv), } type error_fn = fn@(str) -> ! ; fn parse_fmt_string(s: str, error: error_fn) -> [piece] { @@ -261,20 +261,20 @@ mod ct { // implement it this way, I think. mod rt { enum flag { - flag_left_justify; - flag_left_zero_pad; - flag_space_for_sign; - flag_sign_always; - flag_alternate; + flag_left_justify, + flag_left_zero_pad, + flag_space_for_sign, + flag_sign_always, + flag_alternate, // FIXME: This is a hack to avoid creating 0-length vec exprs, // which have some difficulty typechecking currently. See // comments in front::extfmt::make_flags - flag_none; + flag_none, } - enum count { count_is(int); count_implied; } - enum ty { ty_default; ty_bits; ty_hex_upper; ty_hex_lower; ty_octal; } + enum count { count_is(int), count_implied, } + enum ty { ty_default, ty_bits, ty_hex_upper, ty_hex_lower, ty_octal, } // FIXME: May not want to use a vector here for flags; // instead just use a bool per flag @@ -384,7 +384,7 @@ mod rt { ret str::unsafe_from_bytes(svec); } - enum pad_mode { pad_signed; pad_unsigned; pad_nozero; } + enum pad_mode { pad_signed, pad_unsigned, pad_nozero, } fn pad(cv: conv, s: str, mode: pad_mode) -> str { let uwidth; alt cv.width { diff --git a/src/libstd/getopts.rs b/src/libstd/getopts.rs index 29df5770a17..6c21ec1330e 100644 --- a/src/libstd/getopts.rs +++ b/src/libstd/getopts.rs @@ -65,11 +65,11 @@ export opt_strs; export opt_maybe_str; export opt_default; -enum name { long(str); short(char); } +enum name { long(str), short(char), } -enum hasarg { yes; no; maybe; } +enum hasarg { yes, no, maybe, } -enum occur { req; optional; multi; } +enum occur { req, optional, multi, } /* Type: opt @@ -130,7 +130,7 @@ fn optmulti(name: str) -> opt { ret {name: mkname(name), hasarg: yes, occur: multi}; } -enum optval { val(str); given; } +enum optval { val(str), given, } /* Type: match @@ -159,11 +159,11 @@ The type returned when the command line does not conform to the expected format. Pass this value to to get an error message. */ enum fail_ { - argument_missing(str); - unrecognized_option(str); - option_missing(str); - option_duplicated(str); - unexpected_argument(str); + argument_missing(str), + unrecognized_option(str), + option_missing(str), + option_duplicated(str), + unexpected_argument(str), } /* @@ -382,11 +382,11 @@ mod tests { import result::{err, ok}; enum fail_type { - argument_missing_; - unrecognized_option_; - option_missing_; - option_duplicated_; - unexpected_argument_; + argument_missing_, + unrecognized_option_, + option_missing_, + option_duplicated_, + unexpected_argument_, } fn check_fail_type(f: fail_, ft: fail_type) { diff --git a/src/libstd/io.rs b/src/libstd/io.rs index eca266ecfa9..6331e57ea7d 100644 --- a/src/libstd/io.rs +++ b/src/libstd/io.rs @@ -17,7 +17,7 @@ native mod rustrt { // Reading // FIXME This is all buffered. We might need an unbuffered variant as well -enum seek_style { seek_set; seek_end; seek_cur; } +enum seek_style { seek_set, seek_end, seek_cur, } // The raw underlying reader iface. All readers must implement this. @@ -264,7 +264,7 @@ fn string_reader(s: str) -> reader { // Writing -enum fileflag { append; create; truncate; none; } +enum fileflag { append, create, truncate, none, } // FIXME: Seekable really should be orthogonal. // FIXME: eventually u64 @@ -497,15 +497,15 @@ mod fsync { enum level { // whatever fsync does on that platform - fsync; + fsync, // fdatasync on linux, similiar or more on other platforms - fdatasync; + fdatasync, // full fsync // // You must additionally sync the parent directory as well! - fullfsync; + fullfsync, } diff --git a/src/libstd/json.rs b/src/libstd/json.rs index 5b7523e03fd..0229b4d1b22 100644 --- a/src/libstd/json.rs +++ b/src/libstd/json.rs @@ -25,17 +25,17 @@ Represents a json value. */ enum json { /* Variant: num */ - num(float); + num(float), /* Variant: string */ - string(str); + string(str), /* Variant: boolean */ - boolean(bool); + boolean(bool), /* Variant: list */ - list(@[json]); + list(@[json]), /* Variant: dict */ - dict(map::map); + dict(map::map), /* Variant: null */ - null; + null, } /* diff --git a/src/libstd/list.rs b/src/libstd/list.rs index 3286127bb1b..b05f895c327 100644 --- a/src/libstd/list.rs +++ b/src/libstd/list.rs @@ -15,9 +15,9 @@ Tag: list */ enum list { /* Variant: cons */ - cons(T, @list); + cons(T, @list), /* Variant: nil */ - nil; + nil, } /*Section: Operations */ diff --git a/src/libstd/net.rs b/src/libstd/net.rs index e73eed27864..706221d95c2 100644 --- a/src/libstd/net.rs +++ b/src/libstd/net.rs @@ -18,7 +18,7 @@ enum ip_addr { An IPv4 address */ - ipv4(u8, u8, u8, u8); + ipv4(u8, u8, u8, u8), } /* Section: Operations */ diff --git a/src/libstd/rope.rs b/src/libstd/rope.rs index 54d22dde3a2..eb30897b1c0 100644 --- a/src/libstd/rope.rs +++ b/src/libstd/rope.rs @@ -586,8 +586,8 @@ mod node { content - A non-empty rope */ enum root { - empty; - content(@node); + empty, + content(@node), } /* @@ -689,8 +689,8 @@ mod node { concat - The concatenation of two ropes */ enum node { - leaf(leaf); - concat(concat); + leaf(leaf), + concat(concat), } /* diff --git a/src/libstd/test.rs b/src/libstd/test.rs index 7fc63c015ee..707e4cf153f 100644 --- a/src/libstd/test.rs +++ b/src/libstd/test.rs @@ -83,7 +83,7 @@ fn parse_opts(args: [str]) : vec::is_not_empty(args) -> opt_res { ret either::left(test_opts); } -enum test_result { tr_ok; tr_failed; tr_ignored; } +enum test_result { tr_ok, tr_failed, tr_ignored, } // A simple console test runner fn run_tests_console(opts: test_opts, @@ -186,9 +186,9 @@ fn run_tests_console(opts: test_opts, fn use_color() -> bool { ret get_concurrency() == 1u; } enum testevent { - te_filtered([test_desc]); - te_wait(test_desc); - te_result(test_desc, test_result); + te_filtered([test_desc]), + te_wait(test_desc), + te_result(test_desc, test_result), } type monitor_msg = (test_desc, test_result);