Skip to content

Commit

Permalink
Merge pull request #21 from exprust/develop
Browse files Browse the repository at this point in the history
feature: separate handle request in another fn
  • Loading branch information
Ando authored Aug 20, 2023
2 parents ec33ef0 + dc9d6ae commit 2bb53c6
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 2bb53c6

Please sign in to comment.