pub enum CloneScope {
Unit,
Fragment,
}Expand description
What the members of a clone group are.
Orthogonal to CloneClass: a run of statements duplicated verbatim is a
Type-1 clone exactly as a duplicated function is, and the two say different
things about the code. A reader has to be able to tell “these functions are
copies” from “these functions share a copied stretch”, so the distinction
is recorded rather than inferred from how the line ranges compare.
Variants§
Unit
Each member is a whole unit: a function, method, impl block or record.
Fragment
Each member is a run of statements inside a unit. The enclosing units need not be clones of each other, and usually are not.
Implementations§
Trait Implementations§
Source§impl Clone for CloneScope
impl Clone for CloneScope
Source§fn clone(&self) -> CloneScope
fn clone(&self) -> CloneScope
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for CloneScope
Source§impl Debug for CloneScope
impl Debug for CloneScope
impl Eq for CloneScope
Source§impl Ord for CloneScope
impl Ord for CloneScope
Source§fn cmp(&self, other: &CloneScope) -> Ordering
fn cmp(&self, other: &CloneScope) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for CloneScope
impl PartialEq for CloneScope
Source§impl PartialOrd for CloneScope
impl PartialOrd for CloneScope
impl StructuralPartialEq for CloneScope
Auto Trait Implementations§
impl Freeze for CloneScope
impl RefUnwindSafe for CloneScope
impl Send for CloneScope
impl Sync for CloneScope
impl Unpin for CloneScope
impl UnsafeUnpin for CloneScope
impl UnwindSafe for CloneScope
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.