Use assert_eq! rather than assert! where possible

This commit is contained in:
Corey Richardson
2013-05-18 22:02:45 -04:00
parent 3acf37897a
commit cc57ca012a
641 changed files with 2809 additions and 2809 deletions

View File

@@ -319,7 +319,7 @@ pub impl FileMap {
fn next_line(&self, pos: BytePos) {
// the new charpos must be > the last one (or it's the first one).
let lines = &mut *self.lines;
assert!((lines.len() == 0) || (lines[lines.len() - 1] < pos));
assert!((lines.len() == 0) || (lines[lines.len() - 1] < pos))
lines.push(pos);
}
@@ -458,7 +458,7 @@ pub impl CodeMap {
pub fn span_to_snippet(&self, sp: span) -> ~str {
let begin = self.lookup_byte_offset(sp.lo);
let end = self.lookup_byte_offset(sp.hi);
assert!(begin.fm.start_pos == end.fm.start_pos);
assert_eq!(begin.fm.start_pos, end.fm.start_pos);
return str::slice(*begin.fm.src,
begin.pos.to_uint(), end.pos.to_uint()).to_owned();
}