More span

This commit is contained in:
Romain Thomas
2023-11-10 18:38:29 +01:00
parent 3ec79f96b0
commit 879c4c5b3b
7 changed files with 8 additions and 12 deletions
@@ -17,11 +17,13 @@
#include <sstream>
#include <nanobind/stl/string.h>
#include "nanobind/extra/memoryview.hpp"
#include "nanobind/utils.hpp"
#include "LIEF/MachO/LoadCommand.hpp"
#include "MachO/pyMachO.hpp"
namespace LIEF::MachO::py {
template<>
@@ -43,8 +45,7 @@ void create<LoadCommand>(nb::module_& m) {
.def_prop_rw("data",
[] (const LoadCommand& cmd) {
const LoadCommand::raw_t& content = cmd.data();
return nb::memoryview::from_memory(content.data(), content.size());
return nb::to_memoryview(cmd.data());
},
nb::overload_cast<const LoadCommand::raw_t&>(&LoadCommand::data),
"Command's data"_doc)