Rename handler.rs to repository.rs for clarity, pass the directory name as a new() parameter rather than have the repository aware of the OPTIONS static

This commit is contained in:
Barry Pederson
2024-11-03 10:28:14 -08:00
parent 52f502f7a6
commit 1a66c8ede5
6 changed files with 35 additions and 29 deletions
+3 -3
View File
@@ -1,15 +1,15 @@
use crate::handler::FileHandler;
use crate::repository::PasswordDirectory;
use common::{Request, RESPONSE_NO, RESPONSE_OK};
use std::io::{Error, Write};
use std::os::unix::net::UnixStream;
pub struct Server {
stream: UnixStream,
handler: FileHandler,
handler: PasswordDirectory,
}
impl Server {
pub fn new(stream: UnixStream, handler: FileHandler) -> Result<Server, Error> {
pub fn new(stream: UnixStream, handler: PasswordDirectory) -> Result<Server, Error> {
Ok(Server { stream, handler })
}