Skip to content

Commit

Permalink
Restore Rust 1.20 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
ruuda committed Oct 14, 2018
1 parent b11905b commit 84c5e51
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/bin/pris.rs
Expand Up @@ -10,6 +10,7 @@ extern crate serde_derive;
extern crate docopt;
extern crate pris;

use std::cmp;
use std::fs::File;
use std::io::BufReader;
use std::io::Read;
Expand Down Expand Up @@ -145,7 +146,7 @@ fn report_error(input: &[u8], location: usize, len: usize) {
// The length of the mark can be longer than the line, for example when
// token to mark was a multiline string literal. In that case, highlight
// only up to the newline, don't extend the tildes too far.
let mark_len = len.min(line_content.len() + start - location);
let mark_len = cmp::min(len, line_content.len() + start - location);

println!("Parse error at line {}:\n", line);
println!("{}", line_content);
Expand Down

0 comments on commit 84c5e51

Please sign in to comment.