VpnCredentialsBuilder::build() and EapOptions::builder().build() use expect() / panic!() for missing required fields instead of returning Result.
this contradicts the project convention of no unwrap() in library code, and more importantly it means downstream callers can't handle missing fields gracefully — their process just crashes.
VpnCredentialsBuilder::build() — wireguard.rs:511-524:
pub fn build(self) -> VpnCredentials {
let name = self.name.expect("name is required");
let gateway = self.gateway.expect("gateway is required");
let private_key = self.private_key.expect("private_key is required");
if self.peers.is_empty() {
panic!("at least one peer is required");
}
// ...
}
EapOptions builder — wifi.rs:504-517: same pattern with expect() on identity and password.
both should return Result<T, ConnectionError> (or a dedicated builder error) so callers can use ? instead of catching panics.
VpnCredentialsBuilder::build()andEapOptions::builder().build()useexpect()/panic!()for missing required fields instead of returningResult.this contradicts the project convention of no
unwrap()in library code, and more importantly it means downstream callers can't handle missing fields gracefully — their process just crashes.VpnCredentialsBuilder::build()—wireguard.rs:511-524:EapOptionsbuilder —wifi.rs:504-517: same pattern withexpect()onidentityandpassword.both should return
Result<T, ConnectionError>(or a dedicated builder error) so callers can use?instead of catching panics.