chore(errors): Convert match statement to map_err

This commit is contained in:
quexeky
2025-01-13 14:56:46 +11:00
parent e6bc43d708
commit 8461d28a7e

View File

@@ -84,10 +84,7 @@ pub fn fetch_user() -> Result<User, RemoteAccessError> {
return Err(RemoteAccessError::InvalidResponse(err));
}
match response.json::<User>() {
Ok(data) => Ok(data),
Err(e) => Err(e.into()),
}
response.json::<User>().map_err(|e| e.into())
}
fn recieve_handshake_logic(app: &AppHandle, path: String) -> Result<(), RemoteAccessError> {