Skip to content

Commit 19d0f9c

Browse files
A6GibKmbilelmoussaoui
authored andcommitted
server: service: Use &ObjectPath when possible
1 parent dadb685 commit 19d0f9c

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

server/src/service.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ impl Service {
454454
self.connection().object_server()
455455
}
456456

457-
pub async fn collection_from_path(&self, path: &OwnedObjectPath) -> Option<Collection> {
457+
pub async fn collection_from_path(&self, path: &ObjectPath<'_>) -> Option<Collection> {
458458
let collections = self.collections.lock().await;
459459

460460
for collection in collections.iter() {
@@ -485,11 +485,11 @@ impl Service {
485485
None
486486
}
487487

488-
pub async fn session(&self, path: &OwnedObjectPath) -> Option<Session> {
488+
pub async fn session(&self, path: &ObjectPath<'_>) -> Option<Session> {
489489
self.sessions.lock().await.get(path).cloned()
490490
}
491491

492-
pub async fn remove_session(&self, path: &OwnedObjectPath) {
492+
pub async fn remove_session(&self, path: &ObjectPath<'_>) {
493493
self.sessions.lock().await.remove(path);
494494
}
495495

@@ -500,11 +500,11 @@ impl Service {
500500
n_prompts
501501
}
502502

503-
pub async fn prompt(&self, path: &OwnedObjectPath) -> Option<Prompt> {
503+
pub async fn prompt(&self, path: &ObjectPath<'_>) -> Option<Prompt> {
504504
self.prompts.lock().await.get(path).cloned()
505505
}
506506

507-
pub async fn remove_prompt(&self, path: &OwnedObjectPath) {
507+
pub async fn remove_prompt(&self, path: &ObjectPath<'_>) {
508508
self.prompts.lock().await.remove(path);
509509
}
510510

0 commit comments

Comments
 (0)