Expand and remove try_something macro.
Since 2f6226518b
there has been only one invocation.
This commit is contained in:
parent
2113659479
commit
12785dd89c
@ -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![];
|
||||
|
Loading…
Reference in New Issue
Block a user