fix: resolve clippy warnings
Tests / test (push) Has been cancelled

This commit is contained in:
Alex
2026-05-31 02:39:38 +03:00
parent 03eb5ee1f9
commit af0e7ad1ce
2 changed files with 9 additions and 3 deletions
+8 -2
View File
@@ -13,6 +13,12 @@ pub struct DependencyManager {
dependencies: Arc<RwLock<HashMap<TypeId, Arc<dyn Any + Send + Sync>>>>,
}
impl Default for DependencyManager {
fn default() -> Self {
Self::new()
}
}
impl DependencyManager {
pub fn new() -> Self {
Self {
@@ -55,13 +61,13 @@ impl DependencyManager {
service_instance.clone() as Arc<dyn Any + Send + Sync>,
);
return service_instance;
service_instance
}
async fn check_by_type_id(&self, type_id: TypeId) -> bool {
let deps = self.dependencies.read().await;
let got = deps.get(&type_id);
return got.is_some();
got.is_some()
}
pub async fn get<T: Send + Sync + 'static + Service>(&self, from: &str) -> Option<Arc<T>> {
+1 -1
View File
@@ -8,7 +8,7 @@ pub trait Service {
Self: Sized;
fn deps() -> Deps {
return vec![];
vec![]
}
fn name() -> String;