File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -1455,8 +1455,22 @@ Unlike this RFC, the `Extract` class is much simpler.
1455
1455
though unit testing does suggest this works .
1456
1456
1457
1457
As mentioned in the RFC , there are faster algorithms for searching a `T : ! Ord ` slice .
1458
- It is not undecided if we should complicate the standard library to support this though .
1458
+ It is not decided if we should complicate the standard library to support this though .
1459
1459
1460
+ * We could represent `SharedHaystack ` using a more general concept of " cheaply cloneable" :
1461
+
1462
+ ```rust
1463
+ pub trait ShallowClone : Clone {}
1464
+ impl <'a , T : ? Sized + 'a > ShallowClone for & 'a T {}
1465
+ impl <T : ? Sized > ShallowClone for Rc <T > {}
1466
+ impl <T : ? Sized > ShallowClone for Arc <T > {}
1467
+ ```
1468
+
1469
+ and all `H : SharedHaystack ` bound can be replaced by `H : Haystack + ShallowClone `.
1470
+ But this generalization brings more questions e . g. should `[u32 ; N ]: ShallowClone `.
1471
+ This should be better left to a new RFC , and since `SharedHaystack ` is mainly used for
1472
+ the core type `& A ` only , we could keep `SharedHaystack ` unstable longer
1473
+ (a separate track from the main Pattern API ) until this question is resolved .
1460
1474
1461
1475
[RFC 528 ]: https : // github.com/rust-lang/rfcs/pull/528
1462
1476
[RFC 1309 ]: https : // github.com/rust-lang/rfcs/pull/1309
You can’t perform that action at this time.
0 commit comments