Skip to content

Commit 39d4759

Browse files
committed
servo: Merge #2272 - Use derived traits for Au (from mbrubeck:geometry-cleanup); r=Ms2ger
This code did not use derived traits previously because their methods were not inlined, but this was fixed in rust-lang/rust#10557. r? pcwalton Source-Repo: https://github.com/servo/servo Source-Revision: 8af9ce07f8ec9dddc926c1f76ade9e84427034db UltraBlame original commit: de3f2703b11e0d467bf92c052904cb1cfd484a9c
1 parent 715bd94 commit 39d4759

File tree

1 file changed

+10
-341
lines changed

1 file changed

+10
-341
lines changed

servo/src/components/util/geometry.rs

Lines changed: 10 additions & 341 deletions
Original file line numberDiff line numberDiff line change
@@ -44,48 +44,24 @@ std
4444
:
4545
fmt
4646
;
47-
pub
48-
struct
49-
Au
50-
(
51-
pub
52-
i32
53-
)
54-
;
55-
impl
56-
Clone
57-
for
58-
Au
59-
{
6047
#
6148
[
62-
inline
63-
]
64-
fn
65-
clone
49+
deriving
6650
(
67-
&
68-
self
51+
Clone
52+
Eq
53+
Ord
54+
Zero
6955
)
70-
-
71-
>
72-
Au
73-
{
74-
let
56+
]
57+
pub
58+
struct
7559
Au
7660
(
77-
i
61+
pub
62+
i32
7863
)
79-
=
80-
*
81-
self
8264
;
83-
Au
84-
(
85-
i
86-
)
87-
}
88-
}
8965
impl
9066
fmt
9167
:
@@ -142,94 +118,6 @@ n
142118
}
143119
}
144120
impl
145-
Eq
146-
for
147-
Au
148-
{
149-
#
150-
[
151-
inline
152-
]
153-
fn
154-
eq
155-
(
156-
&
157-
self
158-
other
159-
:
160-
&
161-
Au
162-
)
163-
-
164-
>
165-
bool
166-
{
167-
let
168-
Au
169-
(
170-
s
171-
)
172-
=
173-
*
174-
self
175-
;
176-
let
177-
Au
178-
(
179-
o
180-
)
181-
=
182-
*
183-
other
184-
;
185-
s
186-
=
187-
=
188-
o
189-
}
190-
#
191-
[
192-
inline
193-
]
194-
fn
195-
ne
196-
(
197-
&
198-
self
199-
other
200-
:
201-
&
202-
Au
203-
)
204-
-
205-
>
206-
bool
207-
{
208-
let
209-
Au
210-
(
211-
s
212-
)
213-
=
214-
*
215-
self
216-
;
217-
let
218-
Au
219-
(
220-
o
221-
)
222-
=
223-
*
224-
other
225-
;
226-
s
227-
!
228-
=
229-
o
230-
}
231-
}
232-
impl
233121
Add
234122
<
235123
Au
@@ -533,174 +421,6 @@ s
533421
}
534422
}
535423
impl
536-
Ord
537-
for
538-
Au
539-
{
540-
#
541-
[
542-
inline
543-
]
544-
fn
545-
lt
546-
(
547-
&
548-
self
549-
other
550-
:
551-
&
552-
Au
553-
)
554-
-
555-
>
556-
bool
557-
{
558-
let
559-
Au
560-
(
561-
s
562-
)
563-
=
564-
*
565-
self
566-
;
567-
let
568-
Au
569-
(
570-
o
571-
)
572-
=
573-
*
574-
other
575-
;
576-
s
577-
<
578-
o
579-
}
580-
#
581-
[
582-
inline
583-
]
584-
fn
585-
le
586-
(
587-
&
588-
self
589-
other
590-
:
591-
&
592-
Au
593-
)
594-
-
595-
>
596-
bool
597-
{
598-
let
599-
Au
600-
(
601-
s
602-
)
603-
=
604-
*
605-
self
606-
;
607-
let
608-
Au
609-
(
610-
o
611-
)
612-
=
613-
*
614-
other
615-
;
616-
s
617-
<
618-
=
619-
o
620-
}
621-
#
622-
[
623-
inline
624-
]
625-
fn
626-
ge
627-
(
628-
&
629-
self
630-
other
631-
:
632-
&
633-
Au
634-
)
635-
-
636-
>
637-
bool
638-
{
639-
let
640-
Au
641-
(
642-
s
643-
)
644-
=
645-
*
646-
self
647-
;
648-
let
649-
Au
650-
(
651-
o
652-
)
653-
=
654-
*
655-
other
656-
;
657-
s
658-
>
659-
=
660-
o
661-
}
662-
#
663-
[
664-
inline
665-
]
666-
fn
667-
gt
668-
(
669-
&
670-
self
671-
other
672-
:
673-
&
674-
Au
675-
)
676-
-
677-
>
678-
bool
679-
{
680-
let
681-
Au
682-
(
683-
s
684-
)
685-
=
686-
*
687-
self
688-
;
689-
let
690-
Au
691-
(
692-
o
693-
)
694-
=
695-
*
696-
other
697-
;
698-
s
699-
>
700-
o
701-
}
702-
}
703-
impl
704424
One
705425
for
706426
Au
@@ -724,57 +444,6 @@ Au
724444
}
725445
}
726446
impl
727-
Zero
728-
for
729-
Au
730-
{
731-
#
732-
[
733-
inline
734-
]
735-
fn
736-
zero
737-
(
738-
)
739-
-
740-
>
741-
Au
742-
{
743-
Au
744-
(
745-
0
746-
)
747-
}
748-
#
749-
[
750-
inline
751-
]
752-
fn
753-
is_zero
754-
(
755-
&
756-
self
757-
)
758-
-
759-
>
760-
bool
761-
{
762-
let
763-
Au
764-
(
765-
s
766-
)
767-
=
768-
*
769-
self
770-
;
771-
s
772-
=
773-
=
774-
0
775-
}
776-
}
777-
impl
778447
Num
779448
for
780449
Au

0 commit comments

Comments
 (0)