Skip to content

Commit 0acf67f

Browse files
author
Paolo Tranquilli
committed
Rust: run format and linting
1 parent 642002a commit 0acf67f

File tree

3 files changed

+8
-16
lines changed

3 files changed

+8
-16
lines changed

rust/extractor/src/config/deserialize.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,9 @@ impl<'de, S: BuildHasher + Default> Visitor<'de> for MapVisitor<S> {
4747
fn visit_str<E: serde::de::Error>(self, value: &str) -> Result<Self::Value, E> {
4848
Ok(value
4949
.split(['\n', ','])
50-
.map(|s| {
51-
match s.split_once('=') {
52-
Some((key, value)) => (key.to_owned(), Some(value.to_owned())),
53-
None => (s.to_owned(), None),
54-
}
50+
.map(|s| match s.split_once('=') {
51+
Some((key, value)) => (key.to_owned(), Some(value.to_owned())),
52+
None => (s.to_owned(), None),
5553
})
5654
.collect())
5755
}

rust/extractor/src/rust_analyzer.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,7 @@ impl<'a> RustAnalyzer<'a> {
7777
let editioned_file_id = semantics
7878
.attach_first_edition(file_id)
7979
.ok_or("failed to determine rust edition")?;
80-
Ok((
81-
semantics,
82-
editioned_file_id,
83-
input,
84-
))
80+
Ok((semantics, editioned_file_id, input))
8581
}
8682
}
8783
}

rust/extractor/src/translate/base.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -284,16 +284,14 @@ impl<'a> Translator<'a> {
284284
if let Some(value) = semantics
285285
.hir_file_for(expanded)
286286
.macro_file()
287-
.and_then(|macro_call_id| {
288-
semantics
289-
.db
290-
.parse_macro_expansion_error(macro_call_id)
291-
})
287+
.and_then(|macro_call_id| semantics.db.parse_macro_expansion_error(macro_call_id))
292288
{
293289
if let Some(err) = &value.err {
294290
let error = err.render_to_string(semantics.db);
295291
let hir_file_id = semantics.hir_file_for(node.syntax());
296-
if Some(err.span().anchor.file_id.file_id()) == hir_file_id.file_id().map(|f| f.file_id(semantics.db)) {
292+
if Some(err.span().anchor.file_id.file_id())
293+
== hir_file_id.file_id().map(|f| f.file_id(semantics.db))
294+
{
297295
let location = err.span().range
298296
+ semantics
299297
.db

0 commit comments

Comments
 (0)