Skip to content

Commit

Permalink
Remove unwraps in start_daita
Browse files Browse the repository at this point in the history
  • Loading branch information
hulthe committed Aug 20, 2024
1 parent 0c8e91a commit a086e97
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions talpid-wireguard/src/wireguard_go/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,10 @@ impl Tunnel for WgGoTunnel {
let path = self.resource_dir.join("maybenot_machines");
log::debug!("Reading maybenot machines from {}", path.display());

// TODO: errors
let machines = fs::read_to_string(path).unwrap();
let machines = CString::new(machines).unwrap();
let machines =
fs::read_to_string(path).map_err(|e| TunnelError::StartDaita(Box::new(e)))?;
let machines =
CString::new(machines).map_err(|e| TunnelError::StartDaita(Box::new(e)))?;
Ok(machines)
})?;

Expand Down

0 comments on commit a086e97

Please sign in to comment.