add conexion number control
This commit is contained in:
@@ -11,8 +11,8 @@ pub struct Servers{
|
||||
}
|
||||
|
||||
impl Servers {
|
||||
pub fn new() -> Servers {
|
||||
Servers{
|
||||
pub fn new() -> Self {
|
||||
Self{
|
||||
l_servers: Self::get_servers(),
|
||||
}
|
||||
}
|
||||
@@ -23,15 +23,13 @@ impl Servers {
|
||||
let mut ret = HashMap::new();
|
||||
f.read_to_string(&mut s).unwrap();
|
||||
let docs = yaml::YamlLoader::load_from_str(&s).unwrap();
|
||||
let docs2;
|
||||
match &docs[0]["servers"] {
|
||||
yaml::Yaml::Hash(ref h) => docs2 = h,
|
||||
let docs2 = match &docs[0]["servers"] {
|
||||
yaml::Yaml::Hash(ref h) => h,
|
||||
_ => return ret,
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
for (k, v) in docs2{
|
||||
//println!("{}",String::from(doc.as_str().unwrap()));
|
||||
ret.insert(String::from(k.as_str().unwrap()),
|
||||
String::from(v.as_str().unwrap()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user