Skip to content

Commit

Permalink
refactor: avoid exposing mutable variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
rzvxa committed Aug 4, 2024
1 parent 34b9606 commit 055eb29
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions crates/oxc_semantic/src/jsdoc/parser/jsdoc_tag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,15 @@ impl<'a> JSDocTag<'a> {
let (type_part, name_comment_content, span_start) =
match utils::find_type_range(self.body_raw) {
Some((t_start, t_end)) => {
let mut c_start = t_end;
let c_start = {
let mut c_start = t_end;
// +1 if whitespace
if self.body_raw.as_bytes()[c_start] == b' ' {
c_start += 1;
}
c_start
};

// +1 if whitespace
if self.body_raw.as_bytes()[c_start] == b' ' {
c_start += 1;
}
(
Some(JSDocTagTypePart::new(
&self.body_raw[t_start..t_end],
Expand Down

0 comments on commit 055eb29

Please sign in to comment.