mirror of
https://github.com/YGGverse/aquatic-crawler.git
synced 2026-03-31 17:15:35 +00:00
validate supported source format
This commit is contained in:
parent
e3dff43c1f
commit
822005b818
1 changed files with 4 additions and 1 deletions
|
|
@ -7,8 +7,11 @@ use info_hash::InfoHash;
|
||||||
/// * return `None` if the `path` is not reachable
|
/// * return `None` if the `path` is not reachable
|
||||||
pub fn get(path: &str, capacity: usize) -> Option<Vec<InfoHash>> {
|
pub fn get(path: &str, capacity: usize) -> Option<Vec<InfoHash>> {
|
||||||
use std::io::Read;
|
use std::io::Read;
|
||||||
|
if !path.ends_with(".bin") {
|
||||||
|
todo!("Only sources in the `.bin` format are supported!")
|
||||||
|
}
|
||||||
if path.contains("://") {
|
if path.contains("://") {
|
||||||
todo!("URL sources yet not supported")
|
todo!("URL source format is not supported!")
|
||||||
}
|
}
|
||||||
const L: usize = 20; // v1 only
|
const L: usize = 20; // v1 only
|
||||||
let mut r = Vec::with_capacity(capacity);
|
let mut r = Vec::with_capacity(capacity);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue