Given the following code:
struct Lexer {
parse_header: bool,
}
impl Lexer {
fn set_include_mode(parse_header: bool) {
self.parse_header = parse_header;
}
}
<code>
The current output is:
error[E0424]: expected value, found module `self`
--> src/preprocess/lex.rs:18:9
|
17 | fn set_include_mode(parse_header: bool) {
| ---------------- this function doesn't have a `self` parameter
18 | self.parse_header = parse_header;
| ^^^^ `self` value is a keyword only available in methods with a `self` parameter
|
help: add a `self` receiver parameter to make the associated `fn` a method
|
17 | fn set_include_mode(&self, parse_header: bool) {
| ++++++
Ideally the output should look like:
error[E0424]: expected value, found module `self`
--> src/preprocess/lex.rs:18:9
|
17 | fn set_include_mode(parse_header: bool) {
| ---------------- this function doesn't have a `self` parameter
18 | self.parse_header = parse_header;
| ^^^^ `self` value is a keyword only available in methods with a `self` parameter
|
help: add a `self` receiver parameter to make the associated `fn` a method
|
17 | fn set_include_mode(&mut self, parse_header: bool) {
| +++++++++
Given the following code:
The current output is:
Ideally the output should look like: