From e89295b176b4f494d19b547b6b4d7c98d0cf1da1 Mon Sep 17 00:00:00 2001 From: Aaron O'Mullan Date: Thu, 29 Apr 2021 00:16:45 +0200 Subject: refactor(extensions): reintroduce builder (#10412) --- op_crates/file/lib.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'op_crates/file/lib.rs') diff --git a/op_crates/file/lib.rs b/op_crates/file/lib.rs index 19bb8b19b..ccde34ada 100644 --- a/op_crates/file/lib.rs +++ b/op_crates/file/lib.rs @@ -88,14 +88,14 @@ pub fn init( blob_url_store: BlobUrlStore, maybe_location: Option, ) -> Extension { - Extension::with_ops( - include_js_files!( + Extension::builder() + .js(include_js_files!( prefix "deno:op_crates/file", "01_file.js", "02_filereader.js", "03_blob_url.js", - ), - vec![ + )) + .ops(vec![ ( "op_file_create_object_url", op_sync(op_file_create_object_url), @@ -104,15 +104,15 @@ pub fn init( "op_file_revoke_object_url", op_sync(op_file_revoke_object_url), ), - ], - Some(Box::new(move |state| { + ]) + .state(move |state| { state.put(blob_url_store.clone()); if let Some(location) = maybe_location.clone() { state.put(Location(location)); } Ok(()) - })), - ) + }) + .build() } pub fn get_declaration() -> PathBuf { -- cgit v1.2.3