Skip to content

Commit

Permalink
fix: wrong usage of is_ok in if statement
Browse files Browse the repository at this point in the history
  • Loading branch information
Lioncat2002 committed Mar 1, 2025
1 parent 1cdfbc8 commit bac3b54
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion compiler-cli/src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ fn setup(
let warning_emitter = WarningEmitter::new(Rc::new(ConsoleWarningEmitter));

// Warn incase the module being run has been as internal
if built.is_internal(&module.clone().into()).is_ok() {
let internal_module=built.is_internal(&module.clone().into()).unwrap_or(false);
if internal_module {
let warning = Warning::InternalMain {
module: module.clone().into(),
};
Expand Down
6 changes: 6 additions & 0 deletions compiler-core/src/warning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ only lowercase alphanumeric characters or underscores."
"Rename `{path}` to be valid, or remove this file from the project source."
)),
},

Warning::DeprecatedSyntax {
path,
src,
Expand All @@ -279,6 +280,7 @@ like this: `[item, ..list]`.",
extra_labels: vec![],
}),
},

Warning::DeprecatedSyntax {
path,
src,
Expand All @@ -302,6 +304,7 @@ like this: `[item, ..list]`.",
extra_labels: vec![],
}),
},

Warning::DeprecatedSyntax {
path,
src,
Expand All @@ -321,6 +324,7 @@ like this: `[item, ..list]`.",
extra_labels: vec![],
}),
},

Warning::DeprecatedSyntax {
path,
src,
Expand All @@ -343,6 +347,7 @@ To match on all possible lists, use the `_` catch-all pattern instead.",
extra_labels: vec![],
}),
},

Warning::DeprecatedSyntax {
path,
src,
Expand Down Expand Up @@ -371,6 +376,7 @@ To match on all possible lists, use the `_` catch-all pattern instead.",
}),
}
}

Self::Type { path, warning, src } => match warning {
type_::Warning::Todo {
kind,
Expand Down

0 comments on commit bac3b54

Please sign in to comment.