Browse Source

Clarify `Arc` usage

Absent this it's easy to miss that there's an `Arc` being cloned here.
Tamir Duberstein 5 months ago
parent
commit
afd777b705
1 changed files with 1 additions and 1 deletions
  1. 1 1
      aya/src/bpf.rs

+ 1 - 1
aya/src/bpf.rs

@@ -535,7 +535,7 @@ impl<'a> EbpfLoader<'a> {
                 let section = prog_obj.section.clone();
                 let obj = (prog_obj, function_obj);
 
-                let btf_fd = btf_fd.clone();
+                let btf_fd = btf_fd.as_ref().map(Arc::clone);
                 let program = if extensions.contains(name.as_str()) {
                     Program::Extension(Extension {
                         data: ProgramData::new(prog_name, obj, btf_fd, *verifier_log_level),