diff options
author | rabite <rabite@posteo.de> | 2019-06-16 12:43:08 +0200 |
---|---|---|
committer | rabite <rabite@posteo.de> | 2019-06-16 12:43:08 +0200 |
commit | 48cbbf3b8850992d23bf822be46144fbf0e443b5 (patch) | |
tree | df17921997404d2837f88b5352ba25da6bc2b00f /src/textview.rs | |
parent | 8f5ad6b3c947fa058d34a749135e0cdcfd87304b (diff) |
some small clean-ups
Diffstat (limited to 'src/textview.rs')
-rw-r--r-- | src/textview.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/textview.rs b/src/textview.rs index 7dbf35f..159ac5f 100644 --- a/src/textview.rs +++ b/src/textview.rs @@ -1,4 +1,4 @@ -use std::io::BufRead; +use std::io::{BufRead, BufReader}; use crate::files::File; use crate::term::sized_string; @@ -42,8 +42,8 @@ impl TextView { pub fn new_from_file_limit_lines(core: &WidgetCore, file: &File, num: usize) -> HResult<TextView> { - let file = std::fs::File::open(&file.path).unwrap(); - let file = std::io::BufReader::new(file); + let file = std::fs::File::open(&file.path)?; + let file = BufReader::new(file); let lines = file.lines() .take(num) .map(|line| |