Created a section closure
This commit is contained in:
14
src/main.rs
14
src/main.rs
@@ -508,8 +508,12 @@ fn handle_relative_connection(
|
|||||||
.map(|(path, _)| path)
|
.map(|(path, _)| path)
|
||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
|
|
||||||
let _ = writeln!(stream, "<hr>");
|
let section = |stream: &mut TcpStream| {
|
||||||
let _ = writeln!(stream, "<a href=\"/{parent_path}\"><< Back</a>");
|
let _ = writeln!(stream, "<hr>");
|
||||||
|
let _ = writeln!(stream, "<a href=\"/{parent_path}\"><< Back</a>");
|
||||||
|
};
|
||||||
|
|
||||||
|
section(&mut stream);
|
||||||
|
|
||||||
if let Some(pki_path) = pki_path {
|
if let Some(pki_path) = pki_path {
|
||||||
if let Ok(pki_file) = File::open(pki_path) {
|
if let Ok(pki_file) = File::open(pki_path) {
|
||||||
@@ -569,8 +573,7 @@ fn handle_relative_connection(
|
|||||||
convert_subheader(lines.map(|line| line.unwrap_or_default()), &mut stream, 1);
|
convert_subheader(lines.map(|line| line.unwrap_or_default()), &mut stream, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
let _ = writeln!(stream, "<hr>");
|
section(&mut stream);
|
||||||
let _ = writeln!(stream, "<a href=\"/{parent_path}\"><< Back</a>");
|
|
||||||
} else {
|
} else {
|
||||||
unreachable!();
|
unreachable!();
|
||||||
}
|
}
|
||||||
@@ -596,6 +599,5 @@ fn handle_relative_connection(
|
|||||||
let _ = writeln!(stream, "<fieldset><legend>{name}</legend>{text}</fieldset>");
|
let _ = writeln!(stream, "<fieldset><legend>{name}</legend>{text}</fieldset>");
|
||||||
}
|
}
|
||||||
|
|
||||||
let _ = writeln!(stream, "<hr>");
|
section(&mut stream);
|
||||||
let _ = writeln!(stream, "<a href=\"/{parent_path}\"><< Back</a>");
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user