no panic on missing port
This commit is contained in:
parent
66b51fa529
commit
45a69ac003
@ -94,7 +94,12 @@ async fn main() -> std::io::Result<()> {
|
||||
|
||||
let ip_port = conn.split(':').collect::<Vec<&str>>();
|
||||
let addr = ip_port[0];
|
||||
let port = ip_port[1].parse::<u16>().unwrap();
|
||||
let port = ip_port
|
||||
.get(1)
|
||||
.ok_or("<ADRESSE>:<PORT> needed!")
|
||||
.map_err(|e| io::Error::new(io::ErrorKind::Other, e.to_string()))?
|
||||
.parse::<u16>()
|
||||
.unwrap();
|
||||
let controllers = web::Data::from(channel_controllers.clone());
|
||||
let auth_state = web::Data::new(SseAuthState {
|
||||
uuids: tokio::sync::Mutex::new(HashSet::new()),
|
||||
|
@ -154,7 +154,7 @@ impl Iterator for FolderSource {
|
||||
self.sort();
|
||||
}
|
||||
|
||||
self.current_node = match self.manager.current_list.lock().unwrap().get(0) {
|
||||
self.current_node = match self.manager.current_list.lock().unwrap().first() {
|
||||
Some(m) => m.clone(),
|
||||
None => return None,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user