Skip to content

Commit

Permalink
chore: make fields public on PermissionDeniedError and `deno_kv::Kv…
Browse files Browse the repository at this point in the history
…Config` (#26798)

A few small changes to avoid needing unsafe mem transmutes to
instantiate the extensions

---------

Signed-off-by: Richard Carson <[email protected]>
  • Loading branch information
rscarson authored Nov 12, 2024
1 parent c371b2a commit 01f3451
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
21 changes: 11 additions & 10 deletions ext/kv/config.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.

#[derive(Clone, Copy, Debug)]
pub struct KvConfig {
pub(crate) max_write_key_size_bytes: usize,
pub(crate) max_read_key_size_bytes: usize,
pub(crate) max_value_size_bytes: usize,
pub(crate) max_read_ranges: usize,
pub(crate) max_read_entries: usize,
pub(crate) max_checks: usize,
pub(crate) max_mutations: usize,
pub(crate) max_watched_keys: usize,
pub(crate) max_total_mutation_size_bytes: usize,
pub(crate) max_total_key_size_bytes: usize,
pub max_write_key_size_bytes: usize,
pub max_read_key_size_bytes: usize,
pub max_value_size_bytes: usize,
pub max_read_ranges: usize,
pub max_read_entries: usize,
pub max_checks: usize,
pub max_mutations: usize,
pub max_watched_keys: usize,
pub max_total_mutation_size_bytes: usize,
pub max_total_key_size_bytes: usize,
}

impl KvConfig {
Expand Down
4 changes: 2 additions & 2 deletions runtime/permissions/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ pub use prompter::PromptResponse;
#[derive(Debug, thiserror::Error)]
#[error("Requires {access}, {}", format_permission_error(.name))]
pub struct PermissionDeniedError {
access: String,
name: &'static str,
pub access: String,
pub name: &'static str,
}

fn format_permission_error(name: &'static str) -> String {
Expand Down

0 comments on commit 01f3451

Please sign in to comment.