Skip to content

Commit 6c36a9d

Browse files
committed
Fix narrowing conversion warning in row::raw()
Fixes #20
1 parent 01b9a88 commit 6c36a9d

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

include/lazycsv.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ class parser
459459
std::string_view
460460
raw() const
461461
{
462-
return { begin_, end_ - begin_ };
462+
return { begin_, static_cast<std::size_t>(end_ - begin_) };
463463
}
464464

465465
template<typename... Indexes>

test/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ TEST_CASE("parse basic.csv with mmap_source and use cells function")
5757
{ "A3", "B3", "C3", "D3" }
5858
};
5959

60+
REQUIRE_EQ("A0,B0,C0,D0", parser.header().raw());
61+
6062
const auto [a, b, c, d] = parser.header().cells(0, 1, 2, 3);
6163
auto header_cells = expected_rows.at(0);
6264
REQUIRE_EQ(header_cells[0], a.raw());

0 commit comments

Comments
 (0)