* @brief Make a Py::String out of a std::string_view. */ If upstream PyCXX ever gets an std::string_view constructor for Py::String, this can be trivially swapped out for that constructor.
| 108 | // If upstream PyCXX ever gets an std::string_view constructor for Py::String, |
| 109 | // this can be trivially swapped out for that constructor. |
| 110 | inline Py::String toPyString(std::string_view utf8) |
| 111 | { |
| 112 | return { utf8.data(), Py_ssize_t(utf8.size()) }; |
| 113 | } |
| 114 | |
| 115 | } |
| 116 |
no test coverage detected