diff --git a/ui/frontend/selectors/index.ts b/ui/frontend/selectors/index.ts index 70ae36f1a..78b6c5aa2 100644 --- a/ui/frontend/selectors/index.ts +++ b/ui/frontend/selectors/index.ts @@ -10,7 +10,7 @@ const codeSelector = (state: State) => state.code; const HAS_TESTS_RE = /^\s*#\s*\[\s*test\s*([^"]*)]/m; export const hasTestsSelector = createSelector(codeSelector, code => !!code.match(HAS_TESTS_RE)); -const HAS_MAIN_FUNCTION_RE = /^\s*(pub\s+)?\s*(const\s+)?\s*(async\s+)?\s*fn\s+main\s*\(\s*\)/m; +const HAS_MAIN_FUNCTION_RE = /^\s*(pub\s+)?\s*(const\s+)?\s*(async\s+)?\s*fn\s+main\s*(<\s*>)?\(\s*\)/m; export const hasMainFunctionSelector = createSelector(codeSelector, code => !!code.match(HAS_MAIN_FUNCTION_RE)); const CRATE_TYPE_RE = /^\s*#!\s*\[\s*crate_type\s*=\s*"([^"]*)"\s*]/m;