Skip to content

Commit

Permalink
Safely cast Node to Element in _parseSentenceFuriganaPart function
Browse files Browse the repository at this point in the history
  • Loading branch information
petlyh committed Nov 7, 2024
1 parent 5eccb4a commit 5e0d1f3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/packages/jisho_client/parser/furigana.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ Option<FuriganaPart> _parseSentenceFuriganaPart(Node node) => Option.Do(($) {
);
}

final element = node as Element;

final element = $(Option<Element>.safeCast(node));
final unlinked = $(element.queryOption(".unlinked"));
final unlinkedChild = $(unlinked.firstChildOption);
final text = $(unlinkedChild.textOption).trim();
Expand Down

0 comments on commit 5e0d1f3

Please sign in to comment.