summaryrefslogtreecommitdiff
path: root/ext/web/blob.rs
diff options
context:
space:
mode:
authorYiyu Lin <linyiyu1992@gmail.com>2023-01-04 20:20:36 +0800
committerGitHub <noreply@github.com>2023-01-04 13:20:36 +0100
commit319f6074761421b797db71bf10f6171516e3d92a (patch)
tree86d67cc767861e826fff6f2d41c243dbbcd25f60 /ext/web/blob.rs
parent2da882137eecc96e73a8c4f8e9b7d59ccdbfca66 (diff)
chore(cli,ext,rt): remove some unnecessary `clone` or `malloc` (#17261)
Diffstat (limited to 'ext/web/blob.rs')
-rw-r--r--ext/web/blob.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/ext/web/blob.rs b/ext/web/blob.rs
index 7da42e178..24cd13454 100644
--- a/ext/web/blob.rs
+++ b/ext/web/blob.rs
@@ -47,13 +47,10 @@ impl BlobStore {
parts.remove(id)
}
- pub fn get_object_url(
- &self,
- mut url: Url,
- ) -> Result<Option<Arc<Blob>>, AnyError> {
+ pub fn get_object_url(&self, mut url: Url) -> Option<Arc<Blob>> {
let blob_store = self.object_urls.lock();
url.set_fragment(None);
- Ok(blob_store.get(&url).cloned())
+ blob_store.get(&url).cloned()
}
pub fn insert_object_url(
@@ -285,7 +282,7 @@ pub fn op_blob_from_object_url(
let blob_store = state.try_borrow::<BlobStore>().ok_or_else(|| {
type_error("Blob URLs are not supported in this context.")
})?;
- if let Some(blob) = blob_store.get_object_url(url)? {
+ if let Some(blob) = blob_store.get_object_url(url) {
let parts = blob
.parts
.iter()