Skip to content

Commit

Permalink
feature: separate handle request in another fn
Browse files Browse the repository at this point in the history
  • Loading branch information
Ando committed Aug 20, 2023
1 parent 84b0107 commit dc9d6ae
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ pub mod server {
};
}
}

pub fn config(&self) {
self.initialize();
}
}
}

Expand Down Expand Up @@ -99,7 +95,7 @@ pub mod handler {

// Get buffer request and caller properties
match tcp_stream.write_all(&buffer[0..stream_count]) {
Ok(()) => println!("{}", String::from_utf8_lossy(&buffer)),
Ok(()) => Handler::handle_request(&buffer),
Err(e) => panic!("{}", e),
}

Expand All @@ -123,6 +119,10 @@ pub mod handler {
panic!("{}", e);
}
}

pub fn handle_request(buffer: &[u8; 1028]) {
println!("{}", String::from_utf8_lossy(buffer))
}
}
}

Expand Down

0 comments on commit dc9d6ae

Please sign in to comment.