From fe22203e3af2fa722e96b0873d9a35256a81c065 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Thu, 13 Jan 2022 20:23:01 +0000 Subject: [PATCH] Add impl for Copy and Clone for Key struct --- aya/src/maps/lpm_trie.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/aya/src/maps/lpm_trie.rs b/aya/src/maps/lpm_trie.rs index 40d91f4c..1ba65fc1 100644 --- a/aya/src/maps/lpm_trie.rs +++ b/aya/src/maps/lpm_trie.rs @@ -32,7 +32,6 @@ pub struct LpmTrie, K, V> { _v: PhantomData, } -#[derive(Clone, Copy)] #[repr(packed)] pub struct Key { pub key_base: bpf_lpm_trie_key, @@ -51,6 +50,14 @@ impl Key { } } +impl Copy for Key { } + +impl Clone for Key { + fn clone(&self) -> Self { + *self + } +} + // A Pod impl is required as bpf_lpm_trie_key is a key for a map. unsafe impl Pod for Key {}