Remove methods from intro example code
I'd like to keep this first code snippet as focused as possible on the
most important concepts. We'll need to figure out somewhere else to put
exhaustive documentation of the full feature set.
diff --git a/demo-cxx/demo.cc b/demo-cxx/demo.cc
index bc0d976..cd447ea 100644
--- a/demo-cxx/demo.cc
+++ b/demo-cxx/demo.cc
@@ -9,19 +9,13 @@
ThingC::~ThingC() { std::cout << "done with ThingC" << std::endl; }
-const std::string &ThingC::get_name() const {
- std::cout << "I'm a C++ method!" << std::endl;
- return this->appname;
-}
-
std::unique_ptr<ThingC> make_demo(rust::Str appname) {
return std::unique_ptr<ThingC>(new ThingC(std::string(appname)));
}
-void do_thing(SharedThing state) {
- print_r(*state.y);
- state.y->print();
-}
+const std::string &get_name(const ThingC &thing) { return thing.appname; }
+
+void do_thing(SharedThing state) { print_r(*state.y); }
} // namespace example
} // namespace org