diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-02-28 01:01:50 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-02-28 01:01:50 -0500 |
commit | 59528398cf367df1e84372946b7031a2e3eb2b7e (patch) | |
tree | 542f805458e9afa541ebfa6a06d081397aee7fcd /rust-src/src | |
parent | a999dc0a9f22a2f403defa26d09257f7600a4312 (diff) |
rust: BkeySC
Implement a rust equivalent to bkey_s_c, which uses references with the
correct lifetimes: now cmd_list.rs doesn't need unsafe.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'rust-src/src')
-rw-r--r-- | rust-src/src/cmd_list.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/rust-src/src/cmd_list.rs b/rust-src/src/cmd_list.rs index 1d71bf9e..15f3f71f 100644 --- a/rust-src/src/cmd_list.rs +++ b/rust-src/src/cmd_list.rs @@ -17,10 +17,8 @@ fn list_keys(fs: &Fs, opt: Cli) -> anyhow::Result<()> { BtreeIterFlags::PREFETCH); while let Some(k) = iter.peek_and_restart()? { - unsafe { - if (*k.k).p > opt.end { - break; - } + if k.k.p > opt.end { + break; } println!("{}", k.to_text(fs)); |