Skip to content

Commit c66c016

Browse files
CopilotashyanSpada
andauthored
Simplify descriptor.rs get() to use .cloned() directly
Agent-Logs-Url: https://github.com/ashyanSpada/expression_engine_rs/sessions/e76f8236-8653-4bc9-bf47-86b983ff48e3 Co-authored-by: ashyanSpada <22587148+ashyanSpada@users.noreply.github.com>
1 parent ae6a813 commit c66c016

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

src/descriptor.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ impl DescriptorManager {
5656

5757
fn get(&self, key: DescriptorKey) -> Option<Descriptor> {
5858
let binding = self.store.lock().unwrap();
59-
let value = binding.get(&key);
60-
value?;
61-
Some(value.unwrap().clone())
59+
binding.get(&key).cloned()
6260
}
6361

6462
pub fn set_unary_descriptor(&mut self, op: String, descriptor: Arc<UnaryDescriptor>) {

0 commit comments

Comments
 (0)