Remove vector manipulation from demo project
The vector support needs to be covered by our test suite, but it doesn't
need to be featured to this extent in our intro code.
diff --git a/demo-cxx/demo.cc b/demo-cxx/demo.cc
index efa1d1e..cd447ea 100644
--- a/demo-cxx/demo.cc
+++ b/demo-cxx/demo.cc
@@ -15,35 +15,7 @@
const std::string &get_name(const ThingC &thing) { return thing.appname; }
-std::unique_ptr<std::vector<uint8_t>> do_thing(SharedThing state) {
- print_r(*state.y);
- auto vec = std::unique_ptr<std::vector<uint8_t>>(new std::vector<uint8_t>());
- for (uint8_t i = 0; i < 10; i++) {
- vec->push_back(i * i);
- }
- return vec;
-}
-
-JsonBlob get_jb(const rust::Vec<uint8_t> &vec) {
- JsonBlob retval;
-
- std::cout << "incoming vec length is " << vec.size() << "\n";
- auto vec_copy = static_cast<std::vector<uint8_t>>(vec);
- std::cout << "vec_copy length is " << vec_copy.size() << "\n";
- std::cout << "vec_copy[0] is " << (int)vec_copy[0] << "\n";
-
- auto blob = std::unique_ptr<std::vector<uint8_t>>(new std::vector<uint8_t>());
- for (uint8_t i = 0; i < 10; i++) {
- blob->push_back(i * 2);
- }
-
- auto json = std::unique_ptr<std::string>(new std::string("{\"demo\": 23}"));
-
- retval.json = std::move(json);
- retval.blob = std::move(blob);
-
- return retval;
-}
+void do_thing(SharedThing state) { print_r(*state.y); }
} // namespace example
} // namespace org