[][src]Struct rslint_core::groups::errors::NoDuplicateCases

pub struct NoDuplicateCases {}

Disallow duplicate test cases in switch statements.

switch statement clauses can freely have duplicate tests, however this is almost always a mistake, because the second case is unreachable. It is likely that the programmer copied a case clause but did not change the test for it.

Invalid Code Examples

switch (a) {
    case 1:
        break;
    case 2:
        break;
    case 1:
        break;
    default:
        break;
}
switch (a) {
    case foo.bar:
        break;

    case foo . bar:
        break;
}

Implementations

impl NoDuplicateCases[src]

pub fn new() -> Self[src]

Trait Implementations

impl Clone for NoDuplicateCases[src]

impl CstRule for NoDuplicateCases[src]

impl Debug for NoDuplicateCases[src]

impl Default for NoDuplicateCases[src]

impl<'de> Deserialize<'de> for NoDuplicateCases[src]

impl Rule for NoDuplicateCases[src]

impl Serialize for NoDuplicateCases[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> DynClone for T where
    T: Clone
[src]

impl<T> Erasable for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Serialize for T where
    T: Serialize + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.