mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
change non-canonical clone impl to {*self}, fix some doc comments
This commit is contained in:
@@ -141,7 +141,7 @@ pub struct MatchArm<'p, Cx: PatCx> {
|
||||
|
||||
impl<'p, Cx: PatCx> Clone for MatchArm<'p, Cx> {
|
||||
fn clone(&self) -> Self {
|
||||
Self { pat: self.pat, has_guard: self.has_guard, arm_data: self.arm_data }
|
||||
*self
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -174,10 +174,7 @@ pub(crate) enum PatOrWild<'p, Cx: PatCx> {
|
||||
|
||||
impl<'p, Cx: PatCx> Clone for PatOrWild<'p, Cx> {
|
||||
fn clone(&self) -> Self {
|
||||
match self {
|
||||
PatOrWild::Wild => PatOrWild::Wild,
|
||||
PatOrWild::Pat(pat) => PatOrWild::Pat(pat),
|
||||
}
|
||||
*self
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -824,7 +824,7 @@ struct PlaceCtxt<'a, Cx: PatCx> {
|
||||
impl<'a, Cx: PatCx> Copy for PlaceCtxt<'a, Cx> {}
|
||||
impl<'a, Cx: PatCx> Clone for PlaceCtxt<'a, Cx> {
|
||||
fn clone(&self) -> Self {
|
||||
Self { cx: self.cx, ty: self.ty }
|
||||
*self
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user