chore: Replace as_any functions with trait upcasting (#28221)

Closes #ISSUE

Release Notes:

- N/A
This commit is contained in:
Piotr Osiewicz
2025-04-08 22:16:27 +02:00
committed by GitHub
parent 38ec45008c
commit 0b75c13034
13 changed files with 23 additions and 87 deletions
+3 -5
View File
@@ -1,3 +1,4 @@
use std::any::Any;
use std::collections::BTreeSet;
use std::path::PathBuf;
use std::sync::Arc;
@@ -1288,11 +1289,8 @@ impl RemoteServerProjects {
cx.notify();
}));
let Some(scroll_handle) = scroll_state
.scroll_handle()
.as_any()
.downcast_ref::<ScrollHandle>()
else {
let handle = &**scroll_state.scroll_handle() as &dyn Any;
let Some(scroll_handle) = handle.downcast_ref::<ScrollHandle>() else {
unreachable!()
};