refactor: remove as_any function from Aspect since trait upcasting added

This commit is contained in:
Nova
2025-08-21 13:47:19 -07:00
parent f0a494392a
commit 040f86d50d
3 changed files with 0 additions and 8 deletions

View File

@@ -281,9 +281,6 @@ fn generate_aspect(aspect: &Aspect) -> TokenStream {
}
macro_rules! #aspect_macro_name {
() => {
fn as_any(self: Arc<Self>) -> Arc<dyn std::any::Any + Send + Sync + 'static> {
self
}
#[allow(clippy::all)]
fn run_signal(
&self,

View File

@@ -71,9 +71,6 @@ impl AspectIdentifier for Alias {
const ID: u64 = 0;
}
impl Aspect for Alias {
fn as_any(self: Arc<Self>) -> Arc<dyn std::any::Any + Send + Sync + 'static> {
self
}
fn run_signal(
&self,
_calling_client: Arc<Client>,

View File

@@ -303,7 +303,6 @@ pub trait AspectIdentifier: Aspect {
const ID: u64;
}
pub trait Aspect: Any + Send + Sync + 'static {
fn as_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync + 'static>;
fn run_signal(
&self,
calling_client: Arc<Client>,
@@ -337,7 +336,6 @@ impl Aspects {
.get(&A::ID)
// .cloned doesn't work for some reason
.map(|v| v.clone())
.map(|a| a.as_any())
.and_then(|a| Arc::downcast(a).ok())
.ok_or(ServerError::NoAspect(TypeId::of::<A>()))
}