MCPcopy Create free account
hub / github.com/PLSysSec/wave / parse_netlist

Function parse_netlist

waverunner/src/main.rs:59–71  ·  view source on GitHub ↗

Parses a comma-seperated string of triples of the form protocol:ip:port

(s: String)

Source from the content-addressed store, hash-verified

57
58// Parses a comma-seperated string of triples of the form protocol:ip:port
59fn parse_netlist(s: String) -> Result<Netlist> {
60 let mut netlist = empty_netlist();
61 if s.is_empty() {
62 return Ok(netlist);
63 }
64 for (idx, triple_str) in s.split(',').enumerate() {
65 if idx >= netlist.len() {
66 return Err(anyhow!("Too many net endpoints for the allow list"));
67 };
68 netlist[idx] = parse_net_triple(triple_str)?;
69 }
70 Ok(netlist)
71}
72
73fn main() {
74 let matches = App::new("Wave Runner")

Callers 1

mainFunction · 0.85

Calls 4

empty_netlistFunction · 0.85
parse_net_tripleFunction · 0.85
is_emptyMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected