svg_preview: Remove unnecessary dependency on editor (#43147)

Editor is a choke point in our compilation graph while also being a very
common crate that is being edited. So reducing things that depend on it
will generally improve compilation times for us.

Release Notes:

- N/A *or* Added/Fixed/Improved ...
This commit is contained in:
Lukas Wirth
2025-11-20 12:18:50 +01:00
committed by GitHub
parent 1e45c99c80
commit 29f9853978
24 changed files with 127 additions and 119 deletions
+4 -4
View File
@@ -2869,7 +2869,7 @@ impl Workspace {
pub fn active_item_as<I: 'static>(&self, cx: &App) -> Option<Entity<I>> {
let item = self.active_item(cx)?;
item.to_any().downcast::<I>().ok()
item.to_any_view().downcast::<I>().ok()
}
fn active_project_path(&self, cx: &App) -> Option<ProjectPath> {
@@ -11214,7 +11214,7 @@ mod tests {
// Now we can check if the handle we got back errored or not
assert_eq!(
handle.to_any().entity_type(),
handle.to_any_view().entity_type(),
TypeId::of::<TestPngItemView>()
);
@@ -11227,7 +11227,7 @@ mod tests {
.unwrap();
assert_eq!(
handle.to_any().entity_type(),
handle.to_any_view().entity_type(),
TypeId::of::<TestIpynbItemView>()
);
@@ -11276,7 +11276,7 @@ mod tests {
// This _must_ be the second item registered
assert_eq!(
handle.to_any().entity_type(),
handle.to_any_view().entity_type(),
TypeId::of::<TestAlternatePngItemView>()
);