Skip to content

Commit 5e7bfe5

Browse files
committed
Even even more range cleanup
1 parent f537a61 commit 5e7bfe5

4 files changed

Lines changed: 13 additions & 22 deletions

File tree

lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ fn main() {
6262
#[warn(missing_doc)];
6363

6464
#[feature(macro_rules, struct_variant, globs)];
65+
#[macro_escape];
6566

6667
extern mod extra;
6768
extern mod openssl = "github.com/sfackler/rust-openssl";

test.rs

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -366,32 +366,20 @@ fn test_tm_params() {
366366
367367
macro_rules! test_range(
368368
($name:expr, $t:ty, $low:expr, $low_str:expr, $high:expr, $high_str:expr) => ({
369-
let tests = [(Some(Range::new(None, None)), ~"'(,)'"),
370-
(Some(Range::new(Some(RangeBound::new($low, Inclusive)),
371-
None)),
372-
"'[" + $low_str + ",)'"),
373-
(Some(Range::new(Some(RangeBound::new($low, Exclusive)),
374-
None)),
375-
"'(" + $low_str + ",)'"),
376-
(Some(Range::new(None,
377-
Some(RangeBound::new($high, Inclusive)))),
378-
"'(," + $high_str + "]'"),
379-
(Some(Range::new(None,
380-
Some(RangeBound::new($high, Exclusive)))),
381-
"'(," + $high_str + ")'"),
382-
(Some(Range::new(Some(RangeBound::new($low, Inclusive)),
383-
Some(RangeBound::new($high, Inclusive)))),
369+
let tests = [(Some(range!('(', ')')), ~"'(,)'"),
370+
(Some(range!('[' $low, ')')), "'[" + $low_str + ",)'"),
371+
(Some(range!('(' $low, ')')), "'(" + $low_str + ",)'"),
372+
(Some(range!('(', $high ']')), "'(," + $high_str + "]'"),
373+
(Some(range!('(', $high ')')), "'(," + $high_str + ")'"),
374+
(Some(range!('[' $low, $high ']')),
384375
"'[" + $low_str + "," + $high_str + "]'"),
385-
(Some(Range::new(Some(RangeBound::new($low, Inclusive)),
386-
Some(RangeBound::new($high, Exclusive)))),
376+
(Some(range!('[' $low, $high ')')),
387377
"'[" + $low_str + "," + $high_str + ")'"),
388-
(Some(Range::new(Some(RangeBound::new($low, Exclusive)),
389-
Some(RangeBound::new($high, Inclusive)))),
378+
(Some(range!('(' $low, $high ']')),
390379
"'(" + $low_str + "," + $high_str + "]'"),
391-
(Some(Range::new(Some(RangeBound::new($low, Exclusive)),
392-
Some(RangeBound::new($high, Exclusive)))),
380+
(Some(range!('(' $low, $high ')')),
393381
"'(" + $low_str + "," + $high_str + ")'"),
394-
(Some(Range::empty()), ~"'empty'"),
382+
(Some(range!(empty)), ~"'empty'"),
395383
(None, ~"NULL")];
396384
test_type($name, tests);
397385
})

types/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
//! Traits dealing with Postgres data types
2+
#[macro_escape];
23

34
extern mod extra;
45

types/range.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
//! Types dealing with ranges of values
2+
#[macro_escape];
23

34
extern mod extra;
45

0 commit comments

Comments
 (0)