mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
access list: improve naming
This commit is contained in:
parent
4b96cfbdf9
commit
ec5d535ffc
1 changed files with 2 additions and 2 deletions
|
|
@ -35,7 +35,7 @@ impl Default for AccessListConfig {
|
||||||
pub struct AccessList(HashSet<[u8; 20]>);
|
pub struct AccessList(HashSet<[u8; 20]>);
|
||||||
|
|
||||||
impl AccessList {
|
impl AccessList {
|
||||||
fn parse_line_to_info_hash(line: String) -> anyhow::Result<[u8; 20]> {
|
fn parse_info_hash(line: String) -> anyhow::Result<[u8; 20]> {
|
||||||
if line.len() != 20 {
|
if line.len() != 20 {
|
||||||
return Err(anyhow::anyhow!("Info hash is not 20 bytes long: {}", line));
|
return Err(anyhow::anyhow!("Info hash is not 20 bytes long: {}", line));
|
||||||
}
|
}
|
||||||
|
|
@ -63,7 +63,7 @@ impl AccessList {
|
||||||
let mut new_list = HashSet::new();
|
let mut new_list = HashSet::new();
|
||||||
|
|
||||||
for line in reader.lines() {
|
for line in reader.lines() {
|
||||||
new_list.insert(Self::parse_line_to_info_hash(line?)?);
|
new_list.insert(Self::parse_info_hash(line?)?);
|
||||||
}
|
}
|
||||||
|
|
||||||
self.0 = new_list;
|
self.0 = new_list;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue