From d8c4a07e82db42e5feb94f9f9e352d208b5def5c Mon Sep 17 00:00:00 2001 From: TAKO <20227709+HynoR@users.noreply.github.com> Date: Sat, 20 Apr 2024 23:06:22 +0800 Subject: [PATCH] Add Comment feature --- src/config.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/config.rs b/src/config.rs index 27bef63..a697715 100644 --- a/src/config.rs +++ b/src/config.rs @@ -149,6 +149,9 @@ pub fn read_config(conf: String) -> Vec { let strs = contents.split('\n'); for str in strs { + if str.starts_with('#'){ + continue; + } let cells = str.trim().split(',').collect::>(); if cells.len() == 4 || cells.len() == 5 { let mut protocal: Protocol = Protocol::All; @@ -177,4 +180,4 @@ pub fn read_config(conf: String) -> Vec { } } nat_cells -} \ No newline at end of file +}