Remove deprecated Error::description (#109)

This commit is contained in:
Kornel 2018-07-06 12:26:49 +01:00 committed by Josh Holmer
parent 442eaf766c
commit e83762d3b1
5 changed files with 38 additions and 43 deletions

View file

@ -3,7 +3,6 @@ extern crate oxipng;
use oxipng::colors::{BitDepth, ColorType};
use oxipng::png;
use std::collections::HashSet;
use std::error::Error;
use std::fs::remove_file;
use std::path::Path;
use std::path::PathBuf;
@ -36,7 +35,7 @@ fn test_it_converts(
match oxipng::optimize(input, opts) {
Ok(_) => (),
Err(x) => panic!(x.description().to_owned()),
Err(x) => panic!("{}", x),
};
assert!(output.exists());
@ -44,7 +43,7 @@ fn test_it_converts(
Ok(x) => x,
Err(x) => {
remove_file(output).ok();
panic!(x.description().to_owned())
panic!("{}", x)
}
};

View file

@ -5,7 +5,6 @@ use oxipng::deflate::Deflaters;
use oxipng::headers::Headers;
use oxipng::png;
use std::collections::HashSet;
use std::error::Error;
use std::fs::remove_file;
use std::path::Path;
use std::path::PathBuf;
@ -38,7 +37,7 @@ fn test_it_converts(
match oxipng::optimize(input, opts) {
Ok(_) => (),
Err(x) => panic!(x.description().to_owned()),
Err(x) => panic!("{}", x),
};
assert!(output.exists());
@ -46,7 +45,7 @@ fn test_it_converts(
Ok(x) => x,
Err(x) => {
remove_file(output).ok();
panic!(x.description().to_owned())
panic!("{}", x)
}
};
@ -89,7 +88,7 @@ fn strip_headers_list() {
match oxipng::optimize(&input, &opts) {
Ok(_) => (),
Err(x) => panic!(x.description().to_owned()),
Err(x) => panic!("{}", x),
};
assert!(output.exists());
@ -97,7 +96,7 @@ fn strip_headers_list() {
Ok(x) => x,
Err(x) => {
remove_file(output).ok();
panic!(x.description().to_owned())
panic!("{}", x)
}
};
@ -123,7 +122,7 @@ fn strip_headers_safe() {
match oxipng::optimize(&input, &opts) {
Ok(_) => (),
Err(x) => panic!(x.description().to_owned()),
Err(x) => panic!("{}", x),
};
assert!(output.exists());
@ -131,7 +130,7 @@ fn strip_headers_safe() {
Ok(x) => x,
Err(x) => {
remove_file(output).ok();
panic!(x.description().to_owned())
panic!("{}", x)
}
};
@ -157,7 +156,7 @@ fn strip_headers_all() {
match oxipng::optimize(&input, &opts) {
Ok(_) => (),
Err(x) => panic!(x.description().to_owned()),
Err(x) => panic!("{}", x),
};
assert!(output.exists());
@ -165,7 +164,7 @@ fn strip_headers_all() {
Ok(x) => x,
Err(x) => {
remove_file(output).ok();
panic!(x.description().to_owned())
panic!("{}", x)
}
};
@ -191,7 +190,7 @@ fn strip_headers_none() {
match oxipng::optimize(&input, &opts) {
Ok(_) => (),
Err(x) => panic!(x.description().to_owned()),
Err(x) => panic!("{}", x),
};
assert!(output.exists());
@ -199,7 +198,7 @@ fn strip_headers_none() {
Ok(x) => x,
Err(x) => {
remove_file(output).ok();
panic!(x.description().to_owned())
panic!("{}", x)
}
};
@ -223,7 +222,7 @@ fn interlacing_0_to_1() {
match oxipng::optimize(&input, &opts) {
Ok(_) => (),
Err(x) => panic!(x.description().to_owned()),
Err(x) => panic!("{}", x),
};
assert!(output.exists());
@ -231,7 +230,7 @@ fn interlacing_0_to_1() {
Ok(x) => x,
Err(x) => {
remove_file(output).ok();
panic!(x.description().to_owned())
panic!("{}", x)
}
};
@ -253,7 +252,7 @@ fn interlacing_1_to_0() {
match oxipng::optimize(&input, &opts) {
Ok(_) => (),
Err(x) => panic!(x.description().to_owned()),
Err(x) => panic!("{}", x),
};
assert!(output.exists());
@ -261,7 +260,7 @@ fn interlacing_1_to_0() {
Ok(x) => x,
Err(x) => {
remove_file(output).ok();
panic!(x.description().to_owned())
panic!("{}", x)
}
};
@ -285,7 +284,7 @@ fn interlacing_0_to_1_small_files() {
match oxipng::optimize(&input, &opts) {
Ok(_) => (),
Err(x) => panic!(x.description().to_owned()),
Err(x) => panic!("{}", x),
};
assert!(output.exists());
@ -293,7 +292,7 @@ fn interlacing_0_to_1_small_files() {
Ok(x) => x,
Err(x) => {
remove_file(output).ok();
panic!(x.description().to_owned())
panic!("{}", x)
}
};
@ -319,7 +318,7 @@ fn interlacing_1_to_0_small_files() {
match oxipng::optimize(&input, &opts) {
Ok(_) => (),
Err(x) => panic!(x.description().to_owned()),
Err(x) => panic!("{}", x),
};
assert!(output.exists());
@ -327,7 +326,7 @@ fn interlacing_1_to_0_small_files() {
Ok(x) => x,
Err(x) => {
remove_file(output).ok();
panic!(x.description().to_owned())
panic!("{}", x)
}
};
@ -354,7 +353,7 @@ fn interlaced_0_to_1_other_filter_mode() {
match oxipng::optimize(&input, &opts) {
Ok(_) => (),
Err(x) => panic!(x.description().to_owned()),
Err(x) => panic!("{}", x),
};
assert!(output.exists());
@ -362,7 +361,7 @@ fn interlaced_0_to_1_other_filter_mode() {
Ok(x) => x,
Err(x) => {
remove_file(output).ok();
panic!(x.description().to_owned())
panic!("{}", x)
}
};
@ -405,7 +404,7 @@ fn fix_errors() {
match oxipng::optimize(&input, &opts) {
Ok(_) => (),
Err(x) => panic!(x.description().to_owned()),
Err(x) => panic!("{}", x),
};
assert!(output.exists());
@ -413,7 +412,7 @@ fn fix_errors() {
Ok(x) => x,
Err(x) => {
remove_file(output).ok();
panic!(x.description().to_owned())
panic!("{}", x)
}
};

View file

@ -3,7 +3,6 @@ extern crate oxipng;
use oxipng::colors::{BitDepth, ColorType};
use oxipng::png;
use std::collections::HashSet;
use std::error::Error;
use std::fs::remove_file;
use std::path::Path;
use std::path::PathBuf;
@ -37,7 +36,7 @@ fn test_it_converts(
match oxipng::optimize(input, opts) {
Ok(_) => (),
Err(x) => panic!(x.description().to_owned()),
Err(x) => panic!("{}", x),
};
assert!(output.exists());
@ -45,7 +44,7 @@ fn test_it_converts(
Ok(x) => x,
Err(x) => {
remove_file(output).ok();
panic!(x.description().to_owned())
panic!("{}", x)
}
};

View file

@ -3,7 +3,6 @@ extern crate oxipng;
use oxipng::colors::{AlphaOptim, BitDepth, ColorType};
use oxipng::png;
use std::collections::HashSet;
use std::error::Error;
use std::fs::remove_file;
use std::path::Path;
use std::path::PathBuf;
@ -37,7 +36,7 @@ fn test_it_converts(
match oxipng::optimize(input, opts) {
Ok(_) => (),
Err(x) => panic!(x.description().to_owned()),
Err(x) => panic!("{}", x),
};
assert!(output.exists());
@ -45,7 +44,7 @@ fn test_it_converts(
Ok(x) => x,
Err(x) => {
remove_file(output).ok();
panic!(x.description().to_owned())
panic!("{}", x)
}
};
@ -987,7 +986,7 @@ fn palette_should_be_reduced_with_dupes() {
match oxipng::optimize(&input, &opts) {
Ok(_) => (),
Err(x) => panic!(x.description().to_owned()),
Err(x) => panic!("{}", x),
};
assert!(output.exists());
@ -995,7 +994,7 @@ fn palette_should_be_reduced_with_dupes() {
Ok(x) => x,
Err(x) => {
remove_file(&output).ok();
panic!(x.description().to_owned())
panic!("{}", x)
}
};
@ -1020,7 +1019,7 @@ fn palette_should_be_reduced_with_unused() {
match oxipng::optimize(&input, &opts) {
Ok(_) => (),
Err(x) => panic!(x.description().to_owned()),
Err(x) => panic!("{}", x),
};
assert!(output.exists());
@ -1028,7 +1027,7 @@ fn palette_should_be_reduced_with_unused() {
Ok(x) => x,
Err(x) => {
remove_file(&output).ok();
panic!(x.description().to_owned())
panic!("{}", x)
}
};
@ -1053,7 +1052,7 @@ fn palette_should_be_reduced_with_both() {
match oxipng::optimize(&input, &opts) {
Ok(_) => (),
Err(x) => panic!(x.description().to_owned()),
Err(x) => panic!("{}", x),
};
assert!(output.exists());
@ -1061,7 +1060,7 @@ fn palette_should_be_reduced_with_both() {
Ok(x) => x,
Err(x) => {
remove_file(&output).ok();
panic!(x.description().to_owned())
panic!("{}", x)
}
};

View file

@ -3,7 +3,6 @@ extern crate oxipng;
use oxipng::colors::{BitDepth, ColorType};
use oxipng::png;
use std::collections::HashSet;
use std::error::Error;
use std::fs::remove_file;
use std::path::Path;
use std::path::PathBuf;
@ -36,7 +35,7 @@ fn test_it_converts(
match oxipng::optimize(input, opts) {
Ok(_) => (),
Err(x) => panic!(x.description().to_owned()),
Err(x) => panic!("{}", x),
};
assert!(output.exists());
@ -44,7 +43,7 @@ fn test_it_converts(
Ok(x) => x,
Err(x) => {
remove_file(output).ok();
panic!(x.description().to_owned())
panic!("{}", x)
}
};
@ -86,7 +85,7 @@ fn issue_42() {
match oxipng::optimize(&input, &opts) {
Ok(_) => (),
Err(x) => panic!(x.description().to_owned()),
Err(x) => panic!("{}", x),
};
assert!(output.exists());
@ -94,7 +93,7 @@ fn issue_42() {
Ok(x) => x,
Err(x) => {
remove_file(output).ok();
panic!(x.description().to_owned())
panic!("{}", x)
}
};