Skip to content

Commit 788aa2c

Browse files
author
Paolo Tranquilli
committed
Rust: run format and linting
1 parent 9a4ebef commit 788aa2c

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
@@ -292,16 +292,14 @@ impl<'a> Translator<'a> {
292292
if let Some(value) = semantics
293293
.hir_file_for(expanded)
294294
.macro_file()
295-
.and_then(|macro_call_id| {
296-
semantics
297-
.db
298-
.parse_macro_expansion_error(macro_call_id)
299-
})
295+
.and_then(|macro_call_id| semantics.db.parse_macro_expansion_error(macro_call_id))
300296
{
301297
if let Some(err) = &value.err {
302298
let error = err.render_to_string(semantics.db);
303299
let hir_file_id = semantics.hir_file_for(node.syntax());
304-
if Some(err.span().anchor.file_id.file_id()) == hir_file_id.file_id().map(|f| f.file_id(semantics.db)) {
300+
if Some(err.span().anchor.file_id.file_id())
301+
== hir_file_id.file_id().map(|f| f.file_id(semantics.db))
302+
{
305303
let location = err.span().range
306304
+ semantics
307305
.db

0 commit comments

Comments
 (0)