Struct mit_lint::Problem[][src]

pub struct Problem { /* fields omitted */ }
Expand description

Information about the breaking of the lint

Implementations

Create a new problem

Examples

use mit_lint::{Code, Problem};
let problem = Problem::new(
    "Error title".to_string(),
    "Some advice on how to fix it".to_string(),
    Code::BodyWiderThan72Characters,
);

assert_eq!(problem.error(), "Error title".to_string())

Get the code for this problem

Examples

use mit_lint::{Code, Problem};
let problem = Problem::new(
    "Error title".to_string(),
    "Some advice on how to fix it".to_string(),
    Code::BodyWiderThan72Characters,
);

assert_eq!(problem.code(), &Code::BodyWiderThan72Characters)

Get the descriptive title for this error

Examples

use mit_lint::{Code, Problem};
let problem = Problem::new(
    "Error title".to_string(),
    "Some advice on how to fix it".to_string(),
    Code::BodyWiderThan72Characters,
);

assert_eq!(problem.error(), "Error title".to_string())

Get advice on how to fix the problem

This should be a description of why this is a problem, and how to fix it

Examples

use mit_lint::{Code, Problem};
let problem = Problem::new(
    "Error title".to_string(),
    "Some advice on how to fix it".to_string(),
    Code::BodyWiderThan72Characters,
);

assert_eq!(problem.tip(), "Some advice on how to fix it".to_string())

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.