Skip to content

Commit

Permalink
doc change
Browse files Browse the repository at this point in the history
  • Loading branch information
rscarson committed Nov 12, 2024
1 parent c2d3406 commit 362e852
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/ext/kv/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,17 @@ pub struct KvConfig {
impl From<KvConfig> for deno_kv::KvConfig {
fn from(value: KvConfig) -> Self {
assert_eq!(size_of::<KvConfig>(), size_of::<deno_kv::KvConfig>());

// Safety: None - this is horrendously unsafe
unsafe { std::mem::transmute(value) }
}
}
impl Default for KvConfig {
fn default() -> Self {
let cnf = KvConfigBuilder::default().build();
assert_eq!(size_of::<KvConfig>(), size_of::<deno_kv::KvConfig>());

// Safety: None - this is horrendously unsafe
unsafe { std::mem::transmute(cnf) }
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/ext/web/permissions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl From<PermissionDenied> for PermissionCheckError {
std::mem::size_of::<PermissionDeniedError>()
);

// Safety: The Source and Target types are identical
// Safety: None - this is horrendously unsafe
let e: PermissionDeniedError = unsafe { std::mem::transmute(e) };
e.into()
}
Expand Down

0 comments on commit 362e852

Please sign in to comment.