Skip to content

Commit

Permalink
fix string literal length
Browse files Browse the repository at this point in the history
  • Loading branch information
xunilrj committed Sep 7, 2023
1 parent 3c575fb commit e51d72b
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -356,11 +356,7 @@ fn type_check_to_str_array(

match &arg.kind {
ExpressionKind::Literal(Literal::String(s)) => {
let literal_length = s
.as_str()
.len()
.checked_sub(2)
.expect("unexpected string literal with less than 2 characters");
let literal_length = s.as_str().len();
let l = Length::new(literal_length, s.clone());
let t = TypeInfo::StringArray(l);

Expand Down

0 comments on commit e51d72b

Please sign in to comment.