Skip to content

Commit

Permalink
Remove unwraps from Python module initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
fjarri committed Apr 22, 2021
1 parent 9b8adcf commit 9ff25c6
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions umbral-pre-python/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,13 +306,10 @@ fn _umbral(_py: Python, m: &PyModule) -> PyResult<()> {
m.add_class::<Capsule>()?;
m.add_class::<KeyFrag>()?;
m.add_class::<CapsuleFrag>()?;
m.add_function(wrap_pyfunction!(encrypt, m)?).unwrap();
m.add_function(wrap_pyfunction!(decrypt_original, m)?)
.unwrap();
m.add_function(wrap_pyfunction!(generate_kfrags, m)?)
.unwrap();
m.add_function(wrap_pyfunction!(reencrypt, m)?).unwrap();
m.add_function(wrap_pyfunction!(decrypt_reencrypted, m)?)
.unwrap();
m.add_function(wrap_pyfunction!(encrypt, m)?)?;
m.add_function(wrap_pyfunction!(decrypt_original, m)?)?;
m.add_function(wrap_pyfunction!(generate_kfrags, m)?)?;
m.add_function(wrap_pyfunction!(reencrypt, m)?)?;
m.add_function(wrap_pyfunction!(decrypt_reencrypted, m)?)?;
Ok(())
}

0 comments on commit 9ff25c6

Please sign in to comment.