Skip to content

Commit 4f917eb

Browse files
committed
Fix new warning
1 parent d6f10d3 commit 4f917eb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

crates/worker/src/diagnostic.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ impl<'a> SourceCache<'a> {
158158
impl Cache<FileId> for SourceCache<'_> {
159159
type Storage = String;
160160

161-
fn fetch(&mut self, id: &FileId) -> Result<&ariadne::Source, Box<dyn std::fmt::Debug + '_>> {
161+
fn fetch(&mut self, id: &FileId) -> Result<&ariadne::Source, impl std::fmt::Debug> {
162162
let source = match self.cache.entry(*id) {
163163
Entry::Occupied(entry) => entry.into_mut(),
164164
Entry::Vacant(entry) => {
@@ -170,10 +170,10 @@ impl Cache<FileId> for SourceCache<'_> {
170170
entry.insert(source)
171171
}
172172
};
173-
Ok(source)
173+
Ok::<_, Box<dyn std::fmt::Debug>>(source)
174174
}
175175

176-
fn display<'a>(&self, id: &'a FileId) -> Option<Box<dyn std::fmt::Display + 'a>> {
176+
fn display<'a>(&self, id: &'a FileId) -> Option<impl std::fmt::Display + 'a> {
177177
Some(Box::new(format!("{id:?}")))
178178
}
179179
}

0 commit comments

Comments
 (0)