From 4835098cf7ad2dd0641c14a2adf44ce233ba286c Mon Sep 17 00:00:00 2001 From: Aapo Alasuutari Date: Tue, 28 Feb 2023 08:26:48 +0200 Subject: fix(ext/ffi): Remove deno_core::OpState qualifiers, fix ops returning pointer defaults (#17959) --- ext/web/blob.rs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'ext/web/blob.rs') diff --git a/ext/web/blob.rs b/ext/web/blob.rs index 1a7992792..44c8f0ace 100644 --- a/ext/web/blob.rs +++ b/ext/web/blob.rs @@ -12,6 +12,7 @@ use deno_core::error::AnyError; use deno_core::op; use deno_core::parking_lot::Mutex; use deno_core::url::Url; +use deno_core::OpState; use deno_core::ZeroCopyBuf; use serde::Deserialize; use serde::Serialize; @@ -159,10 +160,7 @@ impl BlobPart for SlicedBlobPart { } #[op] -pub fn op_blob_create_part( - state: &mut deno_core::OpState, - data: ZeroCopyBuf, -) -> Uuid { +pub fn op_blob_create_part(state: &mut OpState, data: ZeroCopyBuf) -> Uuid { let blob_store = state.borrow::(); let part = InMemoryBlobPart(data.to_vec()); blob_store.insert_part(Arc::new(part)) @@ -177,7 +175,7 @@ pub struct SliceOptions { #[op] pub fn op_blob_slice_part( - state: &mut deno_core::OpState, + state: &mut OpState, id: Uuid, options: SliceOptions, ) -> Result { @@ -203,7 +201,7 @@ pub fn op_blob_slice_part( #[op] pub async fn op_blob_read_part( - state: Rc>, + state: Rc>, id: Uuid, ) -> Result { let part = { @@ -217,14 +215,14 @@ pub async fn op_blob_read_part( } #[op] -pub fn op_blob_remove_part(state: &mut deno_core::OpState, id: Uuid) { +pub fn op_blob_remove_part(state: &mut OpState, id: Uuid) { let blob_store = state.borrow::(); blob_store.remove_part(&id); } #[op] pub fn op_blob_create_object_url( - state: &mut deno_core::OpState, + state: &mut OpState, media_type: String, part_ids: Vec, ) -> Result { @@ -250,7 +248,7 @@ pub fn op_blob_create_object_url( #[op] pub fn op_blob_revoke_object_url( - state: &mut deno_core::OpState, + state: &mut OpState, url: String, ) -> Result<(), AnyError> { let url = Url::parse(&url)?; @@ -273,7 +271,7 @@ pub struct ReturnBlobPart { #[op] pub fn op_blob_from_object_url( - state: &mut deno_core::OpState, + state: &mut OpState, url: String, ) -> Result, AnyError> { let url = Url::parse(&url)?; -- cgit v1.2.3