Skip to content

Commit

Permalink
Try to work around issues on macos and windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
TkTech committed Jun 21, 2024
1 parent 9a1201f commit 262d5b4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/binding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ PYBIND11_MODULE(can_ada, m) {
m.attr("__version__") = "dev";
#endif

m.def("can_parse", [](std::string_view input, std::optional<std::string_view*> base_input) {
return ada::can_parse(input, base_input.value_or(nullptr));
m.def("can_parse", [](std::string_view input, std::optional<const std::string_view*> base_input) {
if (base_input) {
return ada::can_parse(input, base_input.value());
}
return ada::can_parse(input);
}, py::arg("input"), py::arg("base_input") = py::none());

py::class_<ada::url_aggregator>(m, "URL")
Expand Down

0 comments on commit 262d5b4

Please sign in to comment.