From 822005b8188c42d894e149593962afdc6b222cf4 Mon Sep 17 00:00:00 2001 From: yggverse Date: Thu, 10 Jul 2025 16:23:01 +0300 Subject: [PATCH] validate supported `source` format --- src/api.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/api.rs b/src/api.rs index 535c737..eec76c9 100644 --- a/src/api.rs +++ b/src/api.rs @@ -7,8 +7,11 @@ use info_hash::InfoHash; /// * return `None` if the `path` is not reachable pub fn get(path: &str, capacity: usize) -> Option> { use std::io::Read; + if !path.ends_with(".bin") { + todo!("Only sources in the `.bin` format are supported!") + } if path.contains("://") { - todo!("URL sources yet not supported") + todo!("URL source format is not supported!") } const L: usize = 20; // v1 only let mut r = Vec::with_capacity(capacity);