Skip to content

Commit a144ae6

Browse files
committed
fix: fmt
1 parent 926bc5e commit a144ae6

File tree

2 files changed

+19
-12
lines changed

2 files changed

+19
-12
lines changed

src/cached_source.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,11 @@ impl<T: Source + Hash + PartialEq + Eq + 'static> Source for CachedSource<T> {
104104
// This is based on the following assumptions:
105105
// 1. `SourceMap` will be valid for the entire duration of the application.
106106
// 2. The cached `SourceMap` will not be manually removed or replaced, ensuring the reference's safety.
107-
let map = unsafe { std::mem::transmute::<&SourceMap, &'static SourceMap>(map) };
107+
let map = unsafe {
108+
std::mem::transmute::<&SourceMap, &'static SourceMap>(map)
109+
};
108110
Some(Cow::Borrowed(map))
109-
},
111+
}
110112
None => None,
111113
}
112114
} else {
@@ -122,9 +124,11 @@ impl<T: Source + Hash + PartialEq + Eq + 'static> Source for CachedSource<T> {
122124
// This is based on the following assumptions:
123125
// 1. `SourceMap` will be valid for the entire duration of the application.
124126
// 2. The cached `SourceMap` will not be manually removed or replaced, ensuring the reference's safety.
125-
let map = unsafe { std::mem::transmute::<&SourceMap, &'static SourceMap>(map) };
127+
let map = unsafe {
128+
std::mem::transmute::<&SourceMap, &'static SourceMap>(map)
129+
};
126130
Some(Cow::Borrowed(map))
127-
},
131+
}
128132
None => None,
129133
}
130134
}

src/source_map_source.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -427,11 +427,15 @@ mod tests {
427427
}
428428

429429
test_cached!(source, |s: &dyn Source| s.source().to_string());
430-
test_cached!(source, |s: &dyn Source| s.map(&MapOptions::default()).map(|m| m.into_owned()));
431-
test_cached!(source, |s: &dyn Source| s.map(&MapOptions {
432-
columns: false,
433-
final_source: true
434-
}).map(|m| m.into_owned()));
430+
test_cached!(source, |s: &dyn Source| s
431+
.map(&MapOptions::default())
432+
.map(|m| m.into_owned()));
433+
test_cached!(source, |s: &dyn Source| s
434+
.map(&MapOptions {
435+
columns: false,
436+
final_source: true
437+
})
438+
.map(|m| m.into_owned()));
435439
}
436440

437441
#[test]
@@ -611,9 +615,8 @@ mod tests {
611615
}"#,
612616
)
613617
.unwrap();
614-
let inner_source_map = inner_source
615-
.map(&MapOptions::default())
616-
.map(|map| {
618+
let inner_source_map =
619+
inner_source.map(&MapOptions::default()).map(|map| {
617620
let mut map = map.into_owned();
618621
map.set_source_root(Some("/path/to/folder/".to_string()));
619622
map

0 commit comments

Comments
 (0)