From fefe93c91b63e35bf88f5f432f0cca09948d0623 Mon Sep 17 00:00:00 2001 From: crowlKats <13135287+crowlKats@users.noreply.github.com> Date: Mon, 12 Apr 2021 04:15:43 +0200 Subject: feat(runtime/permissions): prompt fallback (#9376) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Yoshiya Hinosawa Co-authored-by: Bartek IwaƄczuk --- op_crates/websocket/lib.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'op_crates/websocket/lib.rs') diff --git a/op_crates/websocket/lib.rs b/op_crates/websocket/lib.rs index 59fa5acdb..930424aab 100644 --- a/op_crates/websocket/lib.rs +++ b/op_crates/websocket/lib.rs @@ -49,14 +49,14 @@ pub struct WsCaData(pub Vec); pub struct WsUserAgent(pub String); pub trait WebSocketPermissions { - fn check_net_url(&self, _url: &url::Url) -> Result<(), AnyError>; + fn check_net_url(&mut self, _url: &url::Url) -> Result<(), AnyError>; } /// For use with `op_websocket_*` when the user does not want permissions. pub struct NoWebSocketPermissions; impl WebSocketPermissions for NoWebSocketPermissions { - fn check_net_url(&self, _url: &url::Url) -> Result<(), AnyError> { + fn check_net_url(&mut self, _url: &url::Url) -> Result<(), AnyError> { Ok(()) } } @@ -91,7 +91,7 @@ where WP: WebSocketPermissions + 'static, { state - .borrow::() + .borrow_mut::() .check_net_url(&url::Url::parse(&url)?)?; Ok(()) @@ -113,8 +113,8 @@ where WP: WebSocketPermissions + 'static, { { - let s = state.borrow(); - s.borrow::() + let mut s = state.borrow_mut(); + s.borrow_mut::() .check_net_url(&url::Url::parse(&args.url)?) .expect( "Permission check should have been done in op_ws_check_permission", -- cgit v1.2.3