| 439 self.0 |
441 self.0 |
| 440 .eval_ref_decompose(|a| self.1.eval_ref_decompose(|b| f(Pair(a, b)))) |
442 .eval_ref_decompose(|a| self.1.eval_ref_decompose(|b| f(Pair(a, b)))) |
| 441 } |
443 } |
| 442 |
444 |
| 443 #[inline] |
445 #[inline] |
| 444 fn cow<'b>(self) -> MyCow<'b, Pair<A, B>> |
446 fn cow<'b>(self) -> MyCow<'b, Pair<D::OwnedInstance, Q::OwnedInstance>> |
| 445 where |
447 where |
| 446 Self: 'b, |
448 Self: 'b, |
| 447 { |
449 { |
| 448 MyCow::Owned(Pair(self.0.own(), self.1.own())) |
450 MyCow::Owned(Pair(self.0.own(), self.1.own())) |
| 449 } |
451 } |
| 450 |
452 |
| 451 #[inline] |
453 #[inline] |
| 452 fn own(self) -> Pair<A, B> { |
454 fn own(self) -> Pair<D::OwnedInstance, Q::OwnedInstance> { |
| 453 Pair(self.0.own(), self.1.own()) |
455 Pair(self.0.own(), self.1.own()) |
| 454 } |
456 } |
| 455 } |
457 } |
| 456 |
458 |
| 457 impl<'a, A, B, U, V, D, Q> Instance<Pair<A, B>, PairDecomposition<D, Q>> for &'a Pair<U, V> |
459 impl<'a, A, B, U, V, D, Q> Instance<Pair<A, B>, PairDecomposition<D, Q>> for &'a Pair<U, V> |
| 490 self.0 |
492 self.0 |
| 491 .eval_ref_decompose(|a| self.1.eval_ref_decompose(|b| f(Pair(a, b)))) |
493 .eval_ref_decompose(|a| self.1.eval_ref_decompose(|b| f(Pair(a, b)))) |
| 492 } |
494 } |
| 493 |
495 |
| 494 #[inline] |
496 #[inline] |
| 495 fn cow<'b>(self) -> MyCow<'b, Pair<A, B>> |
497 fn cow<'b>(self) -> MyCow<'b, Pair<D::OwnedInstance, Q::OwnedInstance>> |
| 496 where |
498 where |
| 497 Self: 'b, |
499 Self: 'b, |
| 498 { |
500 { |
| 499 MyCow::Owned(self.own()) |
501 MyCow::Owned(self.own()) |
| 500 } |
502 } |
| 501 |
503 |
| 502 #[inline] |
504 #[inline] |
| 503 fn own(self) -> Pair<A, B> { |
505 fn own(self) -> Pair<D::OwnedInstance, Q::OwnedInstance> { |
| 504 let Pair(ref u, ref v) = self; |
506 let Pair(ref u, ref v) = self; |
| 505 Pair(u.own(), v.own()) |
507 Pair(u.own(), v.own()) |
| 506 } |
508 } |
| 507 } |
509 } |
| 508 |
510 |