Skip to content

Commit 12785dd

Browse files
committed
Expand and remove try_something macro.
Since 2f62265 there has been only one invocation.
1 parent 2113659 commit 12785dd

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

src/librustdoc/theme.rs

+7-13
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,6 @@ use rustc_errors::Handler;
88
#[cfg(test)]
99
mod tests;
1010

11-
macro_rules! try_something {
12-
($e:expr, $diag:expr, $out:expr) => {{
13-
match $e {
14-
Ok(c) => c,
15-
Err(e) => {
16-
$diag.struct_err(&e.to_string()).emit();
17-
return $out;
18-
}
19-
}
20-
}};
21-
}
22-
2311
#[derive(Debug, Clone, Eq)]
2412
pub struct CssPath {
2513
pub name: String,
@@ -265,7 +253,13 @@ pub fn test_theme_against<P: AsRef<Path>>(
265253
against: &CssPath,
266254
diag: &Handler,
267255
) -> (bool, Vec<String>) {
268-
let data = try_something!(fs::read(f), diag, (false, vec![]));
256+
let data = match fs::read(f) {
257+
Ok(c) => c,
258+
Err(e) => {
259+
diag.struct_err(&e.to_string()).emit();
260+
return (false, vec![]);
261+
}
262+
};
269263

270264
let paths = load_css_paths(&data);
271265
let mut ret = vec![];

0 commit comments

Comments
 (0)