Expand and remove try_something macro.

Since 2f6226518b
there has been only one invocation.
This commit is contained in:
Alex Aktsipetrov 2020-04-02 19:55:56 +02:00
parent 2113659479
commit 12785dd89c

View File

@ -8,18 +8,6 @@
#[cfg(test)]
mod tests;
macro_rules! try_something {
($e:expr, $diag:expr, $out:expr) => {{
match $e {
Ok(c) => c,
Err(e) => {
$diag.struct_err(&e.to_string()).emit();
return $out;
}
}
}};
}
#[derive(Debug, Clone, Eq)]
pub struct CssPath {
pub name: String,
@ -265,7 +253,13 @@ pub fn test_theme_against<P: AsRef<Path>>(
against: &CssPath,
diag: &Handler,
) -> (bool, Vec<String>) {
let data = try_something!(fs::read(f), diag, (false, vec![]));
let data = match fs::read(f) {
Ok(c) => c,
Err(e) => {
diag.struct_err(&e.to_string()).emit();
return (false, vec![]);
}
};
let paths = load_css_paths(&data);
let mut ret = vec![];