mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
clippy: Fix a few clippy problems in components/scripts/dom
(#31905)
* option_as_ref_deref * fix
This commit is contained in:
parent
1bc63801e7
commit
5aae820f6d
3 changed files with 10 additions and 12 deletions
|
@ -80,7 +80,7 @@ impl Blob {
|
|||
},
|
||||
};
|
||||
|
||||
let type_string = normalize_type_string(&blobPropertyBag.type_.to_string());
|
||||
let type_string = normalize_type_string(blobPropertyBag.type_.as_ref());
|
||||
let blob_impl = BlobImpl::new_from_bytes(bytes, type_string);
|
||||
|
||||
Ok(Blob::new_with_proto(global, proto, blob_impl))
|
||||
|
@ -125,7 +125,7 @@ impl Serializable for Blob {
|
|||
let new_blob_id = blob_impl.blob_id();
|
||||
|
||||
// 2. Store the object at a given key.
|
||||
let blobs = blob_impls.get_or_insert_with(|| HashMap::new());
|
||||
let blobs = blob_impls.get_or_insert_with(HashMap::new);
|
||||
blobs.insert(new_blob_id, blob_impl);
|
||||
|
||||
let PipelineNamespaceId(name_space) = new_blob_id.namespace_id;
|
||||
|
@ -242,7 +242,7 @@ impl BlobMethods for Blob {
|
|||
content_type: Option<DOMString>,
|
||||
) -> DomRoot<Blob> {
|
||||
let type_string =
|
||||
normalize_type_string(&content_type.unwrap_or(DOMString::from("")).to_string());
|
||||
normalize_type_string(content_type.unwrap_or(DOMString::from("")).as_ref());
|
||||
let rel_pos = RelativePos::from_opts(start, end);
|
||||
let blob_impl = BlobImpl::new_sliced(rel_pos, self.blob_id, type_string);
|
||||
Blob::new(&self.global(), blob_impl)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue