use crate::node::Node; pub static CORE_NODES: &str = include_str!("metadata/core_nodes.txt"); pub fn get_core_nodes() -> Vec { let nodes: Vec = CORE_NODES .to_owned() .split('\n') .map(String::from) .collect(); let nodes: Vec = nodes.iter().filter(|&p| !(p.eq(""))).cloned().collect(); let result = nodes .iter() .map(|content| { let data: Vec = content.split(':').map(String::from).collect(); let ip = data.get(0).unwrap(); let port = data.get(1).unwrap().parse::().unwrap(); Node::new(ip, port) }) .collect(); result }