Skip to content

Commit 45686c2

Browse files
committed
feat: re-export cxx::Exception
1 parent 6474ce7 commit 45686c2

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/cpp/mod.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Re-export CXX Exception type to simplify usage
2+
pub use cxx::Exception;
3+
14
use cxx::UniquePtr;
25

36
#[cxx::bridge(namespace = "FastPForLib")]
@@ -84,7 +87,7 @@ pub trait Codec32: CodecWrapper {
8487
&self,
8588
input: &[u32],
8689
output: &'out mut [u32],
87-
) -> Result<&'out mut [u32], cxx::Exception> {
90+
) -> Result<&'out mut [u32], Exception> {
8891
let n = ffi::codec_encode32(self.codec(), input, output)?;
8992
Ok(&mut output[..n])
9093
}
@@ -94,7 +97,7 @@ pub trait Codec32: CodecWrapper {
9497
&self,
9598
input: &[u32],
9699
output: &'out mut [u32],
97-
) -> Result<&'out mut [u32], cxx::Exception> {
100+
) -> Result<&'out mut [u32], Exception> {
98101
let n = ffi::codec_decode32(self.codec(), input, output)?;
99102
Ok(&mut output[..n])
100103
}
@@ -107,7 +110,7 @@ pub trait Codec64: CodecWrapper {
107110
&self,
108111
input: &[u64],
109112
output: &'out mut [u32],
110-
) -> Result<&'out mut [u32], cxx::Exception> {
113+
) -> Result<&'out mut [u32], Exception> {
111114
let n = ffi::codec_encode64(self.codec(), input, output)?;
112115
Ok(&mut output[..n])
113116
}
@@ -117,7 +120,7 @@ pub trait Codec64: CodecWrapper {
117120
&self,
118121
input: &[u32],
119122
output: &'out mut [u64],
120-
) -> Result<&'out mut [u64], cxx::Exception> {
123+
) -> Result<&'out mut [u64], Exception> {
121124
let n = ffi::codec_decode64(self.codec(), input, output)?;
122125
Ok(&mut output[..n])
123126
}

0 commit comments

Comments
 (0)