Skip to content

Commit 8ca2281

Browse files
committed
Clean up Show impl a bit
1 parent 2fbbaac commit 8ca2281

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/types/range.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -202,14 +202,14 @@ impl<S, T> Clone for RangeBound<S, T> where S: BoundSided, T: Clone {
202202

203203
impl<S, T> fmt::Show for RangeBound<S, T> where S: BoundSided, T: fmt::Show {
204204
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
205-
let chars = match self.type_ {
206-
Inclusive => ['[', ']'],
207-
Exclusive => ['(', ')'],
205+
let (lower, upper) = match self.type_ {
206+
Inclusive => ('[', ']'),
207+
Exclusive => ('(', ')'),
208208
};
209209

210210
match BoundSided::side(None::<S>) {
211-
Lower => write!(fmt, "{}{}", chars[0], self.value),
212-
Upper => write!(fmt, "{}{}", self.value, chars[1]),
211+
Lower => write!(fmt, "{}{}", lower, self.value),
212+
Upper => write!(fmt, "{}{}", self.value, upper),
213213
}
214214
}
215215
}

0 commit comments

Comments
 (0)