aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/formdata.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-02-07 05:59:57 +0530
committerbors-servo <lbergstrom+bors@mozilla.com>2016-02-07 05:59:57 +0530
commit28ecb0bba3fa395ed56bb2448a21e02c3ff88c8b (patch)
tree715c25be6722850273c5148a57b25c0e7bb26c33 /components/script/dom/formdata.rs
parent2f52a168caa28fcbdcd84e31f093a866ac12955e (diff)
parent2be49404be8885d97735792c2833d4e8b1cb007f (diff)
downloadservo-28ecb0bba3fa395ed56bb2448a21e02c3ff88c8b.tar.gz
servo-28ecb0bba3fa395ed56bb2448a21e02c3ff88c8b.zip
Auto merge of #9543 - alopatindev:enums_constructors_codingstyle_fix, r=KiChjang
Fix #9508: Beautify our union enums constructors Solves #9508 @jdm Please review. Thanks! <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9543) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/formdata.rs')
-rw-r--r--components/script/dom/formdata.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/components/script/dom/formdata.rs b/components/script/dom/formdata.rs
index 574e702e522..3055e182be6 100644
--- a/components/script/dom/formdata.rs
+++ b/components/script/dom/formdata.rs
@@ -5,7 +5,7 @@
use dom::bindings::cell::DOMRefCell;
use dom::bindings::codegen::Bindings::FormDataBinding;
use dom::bindings::codegen::Bindings::FormDataBinding::FormDataMethods;
-use dom::bindings::codegen::UnionTypes::BlobOrUSVString::{self, eBlob, eUSVString};
+use dom::bindings::codegen::UnionTypes::BlobOrUSVString;
use dom::bindings::error::{Fallible};
use dom::bindings::global::GlobalRef;
use dom::bindings::inheritance::Castable;
@@ -88,8 +88,8 @@ impl FormDataMethods for FormData {
self.data.borrow()
.get(&Atom::from(&*name.0))
.map(|entry| match entry[0] {
- FormDatum::StringData(ref s) => eUSVString(USVString(s.clone())),
- FormDatum::BlobData(ref b) => eBlob(Root::from_ref(&*b)),
+ FormDatum::StringData(ref s) => BlobOrUSVString::USVString(USVString(s.clone())),
+ FormDatum::BlobData(ref b) => BlobOrUSVString::Blob(Root::from_ref(&*b)),
})
}
@@ -99,8 +99,8 @@ impl FormDataMethods for FormData {
.get(&Atom::from(&*name.0))
.map_or(vec![], |data|
data.iter().map(|item| match *item {
- FormDatum::StringData(ref s) => eUSVString(USVString(s.clone())),
- FormDatum::BlobData(ref b) => eBlob(Root::from_ref(&*b)),
+ FormDatum::StringData(ref s) => BlobOrUSVString::USVString(USVString(s.clone())),
+ FormDatum::BlobData(ref b) => BlobOrUSVString::Blob(Root::from_ref(&*b)),
}).collect()
)
}
@@ -114,8 +114,8 @@ impl FormDataMethods for FormData {
// https://xhr.spec.whatwg.org/#dom-formdata-set
fn Set(&self, name: USVString, value: BlobOrUSVString) {
let val = match value {
- eUSVString(s) => FormDatum::StringData(s.0),
- eBlob(b) => FormDatum::BlobData(JS::from_rooted(&b))
+ BlobOrUSVString::USVString(s) => FormDatum::StringData(s.0),
+ BlobOrUSVString::Blob(b) => FormDatum::BlobData(JS::from_rooted(&b))
};
self.data.borrow_mut().insert(Atom::from(&*name.0), vec!(val));
}