From 49ae7abb63a5e9e86619358b1d262df8d0168fdf Mon Sep 17 00:00:00 2001 From: chris west Date: Fri, 8 May 2020 23:59:10 -0700 Subject: [PATCH] always prefix lines without \t with i --- src/server.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/server.rs b/src/server.rs index aa27ec9..42ef368 100644 --- a/src/server.rs +++ b/src/server.rs @@ -287,10 +287,8 @@ fn gph_line_to_gopher(line: &str, req: &Request) -> String { } else { match line.matches('\t').count() { 0 => { - // Insert `i` prefix to any prefix-less lines without tabs. - if line.chars().nth(0) != Some('i') { - line.insert(0, 'i'); - } + // Always insert `i` prefix to any lines without tabs. + line.insert(0, 'i'); line.push_str(&format!("\t(null)\t{}\t{}", req.host, req.port)) } // Auto-add host and port to lines with just a selector.