Merge pull request #382 from Omar007/from-bkey_s_c
Some checks are pending
build / bcachefs-tools-deb (ubuntu-22.04) (push) Waiting to run
build / bcachefs-tools-deb (ubuntu-24.04) (push) Waiting to run
build / bcachefs-tools-rpm (push) Waiting to run
build / bcachefs-tools-msrv (push) Waiting to run
Nix Flake actions / nix-matrix (push) Waiting to run
Nix Flake actions / ${{ matrix.name }} (${{ matrix.system }}) (push) Blocked by required conditions

Implement From<bkey_s_c> trait for BkeySC
This commit is contained in:
koverstreet 2025-05-20 09:55:04 -05:00 committed by GitHub
commit e28050092f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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> { pub struct BkeySCToText<'a, 'b> {
k: &'a BkeySC<'a>, k: &'a BkeySC<'a>,
fs: &'b Fs, fs: &'b Fs,