E0081#

Warning name: regex_match_missing_after

lexmatch パターンは入力に未マッチの接尾部分を残せますが、そのパターンは接尾部分を束縛も明示的な無視もしていません。

マッチを入力の末尾で終える必要がある場合は $ を追加し、そうでなければ after= で残りの接尾部分を束縛または無視してください。

Erroneous example#

///|
pub fn starts_with_digits(input : String) -> Bool {
  lexmatch input {
    re"^[0-9]+" => true
    _ => false
  }
}

Suggestion#

Anchor the regex at the end, or make the suffix explicit with after=suffix or after=_.

///|
pub fn starts_with_digits(input : String) -> Bool {
  lexmatch input {
    (re"^[0-9]+", after=_) => true
    _ => false
  }
}