mirror of
https://github.com/pybind/pybind11.git
synced 2026-03-14 20:27:47 +00:00
enable two new clang-tidy checks (#3988)
* enable two new clang-tidy checks * Use better loop var for char
This commit is contained in:
@@ -31,8 +31,8 @@ py::bytes return_bytes() {
|
||||
std::string print_bytes(const py::bytes &bytes) {
|
||||
std::string ret = "bytes[";
|
||||
const auto value = static_cast<std::string>(bytes);
|
||||
for (size_t i = 0; i < value.length(); ++i) {
|
||||
ret += std::to_string(static_cast<int>(value[i])) + " ";
|
||||
for (char c : value) {
|
||||
ret += std::to_string(static_cast<int>(c)) + ' ';
|
||||
}
|
||||
ret.back() = ']';
|
||||
return ret;
|
||||
|
||||
Reference in New Issue
Block a user