1 files changed, 17 insertions, 0 deletions
diff --git a/rust/src/lib.rs b/rust/src/lib.rs
index 06477880b9..d751889874 100644
--- a/rust/src/lib.rs
+++ b/rust/src/lib.rs
@@ -1,3 +1,5 @@
+use std::convert::Infallible;
+
use lazy_static::lazy_static;
use pyo3::prelude::*;
use pyo3_log::ResetHandle;
@@ -6,6 +8,8 @@ pub mod acl;
pub mod errors;
pub mod events;
pub mod http;
+pub mod identifier;
+pub mod matrix_const;
pub mod push;
pub mod rendezvous;
@@ -50,3 +54,16 @@ fn synapse_rust(py: Python<'_>, m: &Bound<'_, PyModule>) -> PyResult<()> {
Ok(())
}
+
+pub trait UnwrapInfallible<T> {
+ fn unwrap_infallible(self) -> T;
+}
+
+impl<T> UnwrapInfallible<T> for Result<T, Infallible> {
+ fn unwrap_infallible(self) -> T {
+ match self {
+ Ok(val) => val,
+ Err(never) => match never {},
+ }
+ }
+}
|