Skip to content

Commit

Permalink
feat: add clone to structs
Browse files Browse the repository at this point in the history
  • Loading branch information
amustaque97 committed Aug 18, 2024
1 parent cfb7507 commit 37a4994
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ enum MessageType {
JoinResponse,
}

#[derive(Debug)]
#[derive(Debug, Clone)]
struct ServerState {
current_term: u32,
state: RaftState,
Expand Down Expand Up @@ -70,7 +70,7 @@ pub struct LogEntry {
pub data: u32,
}

#[derive(Debug)]
#[derive(Debug, Clone)]
pub struct ServerConfig {
pub election_timeout: Duration,
pub address: SocketAddr,
Expand All @@ -80,6 +80,7 @@ pub struct ServerConfig {
pub storage_location: Option<String>,
}

#[derive(Clone)]
pub struct Server {
pub id: u32,
state: ServerState,
Expand Down

0 comments on commit 37a4994

Please sign in to comment.