diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2020-04-03 13:31:24 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-03 13:31:24 +0200 |
| commit | 5082fe21a814e16f25cb8cfb0ebae7fff5541d0a (patch) | |
| tree | fb79f23b0d42b28e202075a2a264337b5597265a | |
| parent | ea28134f2d404c9c4f998457ca829bea45b63b7a (diff) | |
| parent | 12785dd89c24e1a011b8f386ca1883d786db6f95 (diff) | |
Rollup merge of #70706 - gizmondo:check-theme, r=GuillaumeGomez
Minor cleanup in rustdoc --check-theme Expand and remove try_something macro. Since https://github.com/rust-lang/rust/commit/2f6226518bd5085896a0f27cfd3ea396367ecd50 there has been only one invocation. r? @GuillaumeGomez
| -rw-r--r-- | src/librustdoc/theme.rs | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/src/librustdoc/theme.rs b/src/librustdoc/theme.rs index 9dd1d3706ff..c8eb271c807 100644 --- a/src/librustdoc/theme.rs +++ b/src/librustdoc/theme.rs @@ -8,18 +8,6 @@ use rustc_errors::Handler; #[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![]; |
