-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make RSplit<T, P>: Clone not require T: Clone
This addresses a TODO comment. The behavior of #[derive(Clone)] *does* result in a T: Clone requirement. Add a manual Clone implementation, matching Split and SplitInclusive.
- Loading branch information
1 parent
efd0483
commit afcee19
Showing
2 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// check-pass | ||
|
||
// RSplit<T, P> previously required T: Clone in order to be Clone | ||
|
||
struct NotClone; | ||
|
||
fn main() { | ||
let elements = [NotClone, NotClone, NotClone]; | ||
let rsplit = elements.rsplit(|_| false); | ||
rsplit.clone(); | ||
} |