mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-01 02:05:30 +00:00
AccessListMode: rename Allow to Require and Deny to Forbid
This commit is contained in:
parent
3a2e751668
commit
490c0b037d
5 changed files with 7 additions and 8 deletions
|
|
@ -8,8 +8,8 @@ use serde::{Deserialize, Serialize};
|
|||
#[derive(Clone, Copy, Debug, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub enum AccessListMode {
|
||||
Allow,
|
||||
Deny,
|
||||
Require,
|
||||
Forbid,
|
||||
Ignore,
|
||||
}
|
||||
|
||||
|
|
@ -57,8 +57,8 @@ impl AccessList {
|
|||
|
||||
pub fn allows(&self, list_type: AccessListMode, info_hash_bytes: &[u8; 20]) -> bool {
|
||||
match list_type {
|
||||
AccessListMode::Allow => self.0.contains(info_hash_bytes),
|
||||
AccessListMode::Deny => !self.0.contains(info_hash_bytes),
|
||||
AccessListMode::Require => self.0.contains(info_hash_bytes),
|
||||
AccessListMode::Forbid => !self.0.contains(info_hash_bytes),
|
||||
AccessListMode::Ignore => true,
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue