2013-02-17 17:41:47 -06:00
|
|
|
// Why one-tuples? Because macros.
|
|
|
|
|
2015-03-22 15:13:15 -05:00
|
|
|
|
2013-03-27 11:58:28 -05:00
|
|
|
pub fn main() {
|
2013-02-17 17:41:47 -06:00
|
|
|
match ('c',) {
|
|
|
|
(x,) => {
|
2013-05-18 21:02:45 -05:00
|
|
|
assert_eq!(x, 'c');
|
2013-02-17 17:41:47 -06:00
|
|
|
}
|
|
|
|
}
|
2013-02-18 19:45:56 -06:00
|
|
|
// test the 1-tuple type too
|
|
|
|
let x: (char,) = ('d',);
|
|
|
|
let (y,) = x;
|
2013-05-18 21:02:45 -05:00
|
|
|
assert_eq!(y, 'd');
|
2013-02-17 17:41:47 -06:00
|
|
|
}
|