| skipped 2 lines |
3 | 3 | | use clap::Parser; |
4 | 4 | | |
5 | 5 | | #[derive(Debug, Copy, Clone)] |
6 | | - | pub enum Architecture { |
| 6 | + | pub enum EbpfArchitecture { |
7 | 7 | | BpfEl, |
8 | 8 | | BpfEb, |
9 | 9 | | } |
10 | 10 | | |
11 | | - | impl std::str::FromStr for Architecture { |
| 11 | + | impl std::str::FromStr for EbpfArchitecture { |
12 | 12 | | type Err = String; |
13 | 13 | | |
14 | 14 | | fn from_str(s: &str) -> Result<Self, Self::Err> { |
15 | 15 | | Ok(match s { |
16 | | - | "bpfel-unknown-none" => Architecture::BpfEl, |
17 | | - | "bpfeb-unknown-none" => Architecture::BpfEb, |
| 16 | + | "bpfel-unknown-none" => EbpfArchitecture::BpfEl, |
| 17 | + | "bpfeb-unknown-none" => EbpfArchitecture::BpfEb, |
18 | 18 | | _ => return Err("invalid target".to_owned()), |
19 | 19 | | }) |
20 | 20 | | } |
21 | 21 | | } |
22 | 22 | | |
23 | | - | impl std::fmt::Display for Architecture { |
| 23 | + | impl std::fmt::Display for EbpfArchitecture { |
24 | 24 | | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { |
25 | 25 | | f.write_str(match self { |
26 | | - | Architecture::BpfEl => "bpfel-unknown-none", |
27 | | - | Architecture::BpfEb => "bpfeb-unknown-none", |
| 26 | + | EbpfArchitecture::BpfEl => "bpfel-unknown-none", |
| 27 | + | EbpfArchitecture::BpfEb => "bpfeb-unknown-none", |
28 | 28 | | }) |
29 | 29 | | } |
30 | 30 | | } |
| skipped 26 lines |
57 | 57 | | pub struct Options { |
58 | 58 | | /// Set the endianness of the BPF target |
59 | 59 | | #[clap(default_value = "bpfel-unknown-none", long)] |
60 | | - | pub target: Architecture, |
| 60 | + | pub target: EbpfArchitecture, |
61 | 61 | | /// Build the release target |
62 | 62 | | #[clap(long)] |
63 | 63 | | pub release: bool, |
| skipped 39 lines |