rm trailing newlines & add type alias for Vec

This commit is contained in:
zedddie 2026-03-15 13:31:20 +01:00 committed by tuturuu
parent c849d32fe6
commit 2a01827e6c
No known key found for this signature in database
GPG key ID: B352C3C2894405A7
3 changed files with 6 additions and 5 deletions

View file

@ -2,4 +2,4 @@
Tun-in interface with marching on TOR/I2P similar to v2ray/xray Tun-in interface with marching on TOR/I2P similar to v2ray/xray
The project is designed by the desire to transfer all the charms of routing and tun-in of modern VPN cores to Mesh networks. The project is designed by the desire to transfer all the charms of routing and tun-in of modern VPN cores to Mesh networks.

View file

@ -11,9 +11,9 @@ pub enum RunTypes {
pub struct NSCConfig { pub struct NSCConfig {
/// Paths to v2ray `geosite.dat', `geoip.dat` /// Paths to v2ray `geosite.dat', `geoip.dat`
pub geo_files: [String; 2], pub geo_files: [String; 2],
/// Routing settings similar to v2ray /// Routing settings similar to v2ray
pub routing: String, pub routing: String,
/// TOR/I2P Proxies /// TOR/I2P Proxies
pub mode: RunTypes, pub mode: RunTypes,
} }

View file

@ -16,6 +16,8 @@ pub enum RouteAction {
Direct, Direct,
} }
type Rules = Vec<Rule>;
/// Type for declaring the routing rules like: /// Type for declaring the routing rules like:
/// ```toml /// ```toml
/// [rule] /// [rule]
@ -31,9 +33,8 @@ pub struct Rule {
pub action: RouteAction, pub action: RouteAction,
} }
pub fn parse_ruleset(config: NSCConfig) -> Result<Vec<Rule>, Box<dyn std::error::Error>> { pub fn parse_ruleset(config: NSCConfig) -> Result<Rules, Box<dyn std::error::Error>> {
let reader = maxminddb::Reader::open_readfile(config.geo_files[0].clone())?; let reader = maxminddb::Reader::open_readfile(config.geo_files[0].clone())?;
// Ok(()) // Ok(())
todo!(); todo!();