Changed the file_contents to be stored in an &str
This commit is contained in:
@@ -23,13 +23,14 @@ lazy_static! {
|
||||
// TODO, Avoid copying bytes
|
||||
fn main() -> io::Result<()>
|
||||
{
|
||||
#![warn(clippy::pedantic, clippy::perf)]
|
||||
// Default values
|
||||
const BIND_ADDRESS: &str = "127.0.0.1:2008";
|
||||
const INDEX_FILE: &str = "index.npon";
|
||||
|
||||
let (tx, rx) = mpsc::channel();
|
||||
let listener = TcpListener::bind(BIND_ADDRESS).unwrap();
|
||||
println!("Listening at {}", BIND_ADDRESS);
|
||||
println!("Listening at {BIND_ADDRESS}");
|
||||
|
||||
/*
|
||||
let mut file_list: Vec<std::path::PathBuf> = vec![ROOT_DIR.join(INDEX_FILE)];
|
||||
@@ -43,9 +44,10 @@ fn main() -> io::Result<()>
|
||||
let mut file_list: Vec<PathBuf>;
|
||||
(bytes, file_list) = files::read_file(INDEX_FILE, 0);
|
||||
file_list.push(ROOT_DIR.join(INDEX_FILE));
|
||||
println!("Tracking: {:?}", file_list);
|
||||
|
||||
tx.send(bytes.clone()).unwrap();
|
||||
'watch_loop: loop
|
||||
loop
|
||||
{
|
||||
let code = files::watch_files(&file_list);
|
||||
if code == 0
|
||||
|
||||
Reference in New Issue
Block a user