mirror of
https://github.com/YGGverse/hlstate-rs.git
synced 2026-03-31 09:05:42 +00:00
use hash set
This commit is contained in:
parent
d4582589f9
commit
105409a76b
2 changed files with 7 additions and 3 deletions
|
|
@ -1,5 +1,8 @@
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use std::net::{IpAddr, SocketAddr};
|
use std::{
|
||||||
|
collections::HashSet,
|
||||||
|
net::{IpAddr, SocketAddr},
|
||||||
|
};
|
||||||
|
|
||||||
#[derive(Debug, Deserialize)]
|
#[derive(Debug, Deserialize)]
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
|
|
@ -7,7 +10,7 @@ pub struct Config {
|
||||||
pub description: Option<String>,
|
pub description: Option<String>,
|
||||||
pub format_time: String,
|
pub format_time: String,
|
||||||
pub host: IpAddr,
|
pub host: IpAddr,
|
||||||
pub masters: Vec<SocketAddr>,
|
pub masters: HashSet<SocketAddr>,
|
||||||
pub port: u16,
|
pub port: u16,
|
||||||
pub title: String,
|
pub title: String,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
use rocket::serde::Serialize;
|
use rocket::serde::Serialize;
|
||||||
|
use std::collections::HashSet;
|
||||||
|
|
||||||
#[derive(Clone, Debug, Serialize)]
|
#[derive(Clone, Debug, Serialize)]
|
||||||
#[serde(crate = "rocket::serde")]
|
#[serde(crate = "rocket::serde")]
|
||||||
pub struct Global {
|
pub struct Global {
|
||||||
pub format_time: String,
|
pub format_time: String,
|
||||||
pub masters: Vec<std::net::SocketAddr>,
|
pub masters: HashSet<std::net::SocketAddr>,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue