pub fn read_securenets(file: impl AsRef<Path>, iplist: &mut IpList) -> io::Result<()> {
    let buffer = std::fs::read_to_string(&file)?;
    for line in buffer.split('\n') {
        let line = line.trim_start();
        if line.is_empty() || line.starts_with("#") {
            continue;
        }
        let words = line.split_whitespace().collect::<Vec<_>>();
        if let Ok(ipnet) = parse_ip(words) {
            iplist.add(ipnet);
        }
    }
    iplist.finalize();
    Ok(())
}
/// Read a file in the NIS ypserv.securenets format.
Read a file in the NIS ypserv.securenets format.
Read a file in the NIS ypserv . securenets format .
pub fn read_securenets(file: impl AsRef<Path>, iplist: &mut IpList) -> io::Result<()> {
    let buffer = std::fs::read_to_string(&file)?;
    for line in buffer.split('\n') {
        let line = line.trim_start();
        if line.is_empty() || line.starts_with("#") {
            continue;
        }
        let words = line.split_whitespace().collect::<Vec<_>>();
        if let Ok(ipnet) = parse_ip(words) {
            iplist.add(ipnet);
        }
    }
    iplist.finalize();
    Ok(())
}
pub fn read_securenets ( file : impl AsRef < Path > , iplist : & mut IpList ) -> io :: Result < ( ) > { let buffer = std :: fs :: read_to_string ( & file ) ? ; for line in buffer . split ( '\n' ) { let line = line . trim_start ( ) ; if line . is_empty ( ) || line . starts_with ( " " ) { continue ; } let words = line . split_whitespace ( ) . collect :: < Vec < _ > > ( ) ; if let Ok ( ipnet ) = parse_ip ( words ) { iplist . add ( ipnet ) ; } } iplist . finalize ( ) ; Ok ( ( ) ) }
Read a file in the NIS ypserv.securenets format.
Read a file in the NIS ypserv . securenets format .
file
impl AsRef<Path>
iplist
&mut IpList