diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-10-12 17:55:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-12 15:55:50 +0000 |
commit | c464cd7073c761780b3170a48542c387560e3f26 (patch) | |
tree | 881a26d05423f9c696c8f35ce8bd2d72d562b1ea /ext/kv/lib.rs | |
parent | 5dd010a4fbeb0602891ea537b98216b8ad7d27a7 (diff) |
refactor: FeatureChecker integration in ext/ crates (#20797)
Towards https://github.com/denoland/deno/issues/20779.
Diffstat (limited to 'ext/kv/lib.rs')
-rw-r--r-- | ext/kv/lib.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/kv/lib.rs b/ext/kv/lib.rs index 3056e4660..e99b14552 100644 --- a/ext/kv/lib.rs +++ b/ext/kv/lib.rs @@ -33,6 +33,8 @@ use serde::Serialize; pub use crate::interface::*; +pub const UNSTABLE_FEATURE_NAME: &str = "kv"; + const MAX_WRITE_KEY_SIZE_BYTES: usize = 2048; // range selectors can contain 0x00 or 0xff suffixes const MAX_READ_KEY_SIZE_BYTES: usize = MAX_WRITE_KEY_SIZE_BYTES + 1; @@ -89,9 +91,11 @@ where { let handler = { let state = state.borrow(); + // TODO(bartlomieju): replace with `state.feature_checker.check_or_exit` + // once we phase out `check_or_exit_with_legacy_fallback` state .feature_checker - .check_legacy_unstable_or_exit("Deno.openKv"); + .check_or_exit_with_legacy_fallback(UNSTABLE_FEATURE_NAME, "Deno.openKv"); state.borrow::<Rc<DBH>>().clone() }; let db = handler.open(state.clone(), path).await?; |