Skip to content

Commit

Permalink
allow commenting in source files with #
Browse files Browse the repository at this point in the history
  • Loading branch information
Mqlvin committed Dec 11, 2024
1 parent 6a1f91d commit d6c4d10
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,14 @@ fn main() {
for line in f_reader.lines() {
if let Ok(val) = line {
// This set of code is identical to the URL parsing above
let url_obj = Url::parse(&val);
let uncommented_value = val.split("#").next().unwrap_or(&val);

let url_obj = Url::parse(&uncommented_value);

if let Err(_) = url_obj {
println!(
" ERR: Error parsing the URL '{}' in the file '{}'",
val, source
uncommented_value, source
);
continue;
}
Expand Down

0 comments on commit d6c4d10

Please sign in to comment.