mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Clippy: Fix the error of variants having the same prefix. (#31953)
* fix error: all variants have same prefix * made the suggested changes * fixed errors caused by commit * silenced the clippy warning. * ran ./mach fmt * Update components/script/dom/htmlmediaelement.rs Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com> --------- Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
parent
9ee45425e9
commit
275fad8b78
5 changed files with 41 additions and 45 deletions
|
@ -41,9 +41,9 @@ use crate::task_source::{TaskSource, TaskSourceName};
|
|||
|
||||
#[derive(Clone, Copy, JSTraceable, MallocSizeOf, PartialEq)]
|
||||
pub enum FileReaderFunction {
|
||||
ReadAsText,
|
||||
ReadAsDataUrl,
|
||||
ReadAsArrayBuffer,
|
||||
Text,
|
||||
DataUrl,
|
||||
ArrayBuffer,
|
||||
}
|
||||
|
||||
pub type TrustedFileReader = Trusted<FileReader>;
|
||||
|
@ -253,13 +253,13 @@ impl FileReader {
|
|||
// Step 8.2
|
||||
|
||||
match data.function {
|
||||
FileReaderFunction::ReadAsDataUrl => {
|
||||
FileReaderFunction::DataUrl => {
|
||||
FileReader::perform_readasdataurl(&fr.result, data, &blob_contents)
|
||||
},
|
||||
FileReaderFunction::ReadAsText => {
|
||||
FileReaderFunction::Text => {
|
||||
FileReader::perform_readastext(&fr.result, data, &blob_contents)
|
||||
},
|
||||
FileReaderFunction::ReadAsArrayBuffer => {
|
||||
FileReaderFunction::ArrayBuffer => {
|
||||
let _ac = enter_realm(&*fr);
|
||||
FileReader::perform_readasarraybuffer(
|
||||
&fr.result,
|
||||
|
@ -349,17 +349,17 @@ impl FileReaderMethods for FileReader {
|
|||
|
||||
// https://w3c.github.io/FileAPI/#dfn-readAsArrayBuffer
|
||||
fn ReadAsArrayBuffer(&self, blob: &Blob) -> ErrorResult {
|
||||
self.read(FileReaderFunction::ReadAsArrayBuffer, blob, None)
|
||||
self.read(FileReaderFunction::ArrayBuffer, blob, None)
|
||||
}
|
||||
|
||||
// https://w3c.github.io/FileAPI/#dfn-readAsDataURL
|
||||
fn ReadAsDataURL(&self, blob: &Blob) -> ErrorResult {
|
||||
self.read(FileReaderFunction::ReadAsDataUrl, blob, None)
|
||||
self.read(FileReaderFunction::DataUrl, blob, None)
|
||||
}
|
||||
|
||||
// https://w3c.github.io/FileAPI/#dfn-readAsText
|
||||
fn ReadAsText(&self, blob: &Blob, label: Option<DOMString>) -> ErrorResult {
|
||||
self.read(FileReaderFunction::ReadAsText, blob, label)
|
||||
self.read(FileReaderFunction::Text, blob, label)
|
||||
}
|
||||
|
||||
// https://w3c.github.io/FileAPI/#dfn-abort
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue