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:
@@ -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 })
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user