This commit is contained in:
parent
4e125c611c
commit
fb0fa1f351
7 changed files with 16 additions and 18 deletions
|
@ -1,5 +1,5 @@
|
|||
use serde::Deserialize;
|
||||
use crate::Architecture;
|
||||
use serde::Deserialize;
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Default)]
|
||||
pub struct Config {
|
||||
|
@ -15,21 +15,15 @@ pub struct MirrorConfig {
|
|||
#[derive(Debug, Clone, Deserialize, Default)]
|
||||
pub struct Mirrorlist {
|
||||
pub x86_64: Vec<String>,
|
||||
pub aarch64: Vec<String>
|
||||
pub aarch64: Vec<String>,
|
||||
}
|
||||
|
||||
impl Mirrorlist {
|
||||
pub fn for_arch(&self, arch: Architecture) -> &[String] {
|
||||
match arch {
|
||||
Architecture::x86_64 => {
|
||||
&self.x86_64
|
||||
},
|
||||
Architecture::aarch64 => {
|
||||
&self.aarch64
|
||||
},
|
||||
Architecture::any => {
|
||||
&self.x86_64
|
||||
},
|
||||
Architecture::x86_64 => &self.x86_64,
|
||||
Architecture::aarch64 => &self.aarch64,
|
||||
Architecture::any => &self.x86_64,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue