mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-12-10 00:00:24 +03:00
Implement From<bkey_s_c> trait for BkeySC
BkeySC currently implements a From trait for the bkey_i bindgen/C struct, but not its own direct counterpart; bkey_s_c. This implements the From trait for bkey_s_c as well.
This commit is contained in:
parent
3139850c75
commit
e2e2cb034b
@ -125,6 +125,16 @@ impl<'a> From<&'a c::bkey_i> for BkeySC<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> From<&'a c::bkey_s_c> for BkeySC<'a> {
|
||||
fn from(k: &'a c::bkey_s_c) -> Self {
|
||||
BkeySC {
|
||||
k: unsafe { &*k.k },
|
||||
v: unsafe { &*k.v },
|
||||
iter: PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct BkeySCToText<'a, 'b> {
|
||||
k: &'a BkeySC<'a>,
|
||||
fs: &'b Fs,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user