Skip to content

Commit e787b85

Browse files
eagleoflqjwengxt
andauthored
fix: iterator is not pointer (#1230)
Co-authored-by: Weng Xuetian <wengxt@gmail.com>
1 parent ed5c8e5 commit e787b85

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lib/fcitx-utils/semver.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ bool isIdChar(char c) {
3333
}
3434

3535
std::optional<uint32_t> consumeNumericIdentifier(std::string_view &str) {
36-
const auto *endOfNum =
36+
std::string_view::iterator endOfNum =
3737
std::find_if_not(str.begin(), str.end(), charutils::isdigit);
3838
auto length = std::distance(str.begin(), endOfNum);
3939
if (length == 0) {
@@ -45,8 +45,8 @@ std::optional<uint32_t> consumeNumericIdentifier(std::string_view &str) {
4545

4646
auto numberStr = str.substr(0, length);
4747
uint32_t number;
48-
if (auto [p, ec] =
49-
std::from_chars(numberStr.begin(), numberStr.end(), number);
48+
if (auto [p, ec] = std::from_chars(
49+
numberStr.data(), numberStr.data() + numberStr.size(), number);
5050
ec == std::errc()) {
5151
str.remove_prefix(length);
5252
return number;

0 commit comments

Comments
 (0)