Skip to content

Commit

Permalink
Clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
archer884 committed Jun 12, 2017
1 parent 7a00d3f commit 14efdf0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ impl App {
let font = build_font(&options.font_path)?;
let mut canvas = options.base_image.get()
.map_err(|e| AppRunError::not_found("Base image not found", Some(Box::new(e))))
.and_then(|mut buf| {
Canvas::read_from_buffer(&mut buf)
.and_then(|buf| {
Canvas::read_from_buffer(&buf)
.map_err(|e| AppRunError::bad_image(Some(Box::new(e))))
})?;

Expand All @@ -28,11 +28,10 @@ fn build_font(path: &Path) -> Result<Typeface, AppRunError> {
use std::fs::File;
use std::io::BufReader;

let mut data = File::open(path)
.map(|file| BufReader::new(file))
let data = File::open(path)
.map_err(|e| AppRunError::not_found("Font not found", Some(Box::new(e))))?;

artano::load_typeface(&mut data)
artano::load_typeface(&mut BufReader::new(data))
.map_err(|e| AppRunError::io("Unable to read font", Some(Box::new(e))))
}

Expand Down

0 comments on commit 14efdf0

Please sign in to comment.