Skip to content

Commit 2319710

Browse files
committed
refactor(linter): shorten code (#12070)
Pure refactor. Return `Result` directly, rather than going via a temp var.
1 parent e2a7d6a commit 2319710

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

crates/oxc_linter/src/config/oxlintrc.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,9 @@ impl Oxlintrc {
156156
let json = serde_json::from_str::<serde_json::Value>(json_string)
157157
.unwrap_or(serde_json::Value::Null);
158158

159-
let config = Self::deserialize(&json).map_err(|err| {
159+
Self::deserialize(&json).map_err(|err| {
160160
OxcDiagnostic::error(format!("Failed to parse config with error {err:?}"))
161-
})?;
162-
163-
Ok(config)
161+
})
164162
}
165163

166164
/// Merges two [Oxlintrc] files together

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy