1 A private item was used outside of its scope.
3 Erroneous code example:
15 foo.method(); // error: method `method` is private
18 Two possibilities are available to solve this issue:
20 1. Only use the item in the scope it has been defined:
30 pub fn call_method(foo: &Foo) { // We create a public function.
31 foo.method(); // Which calls the item.
36 inner::call_method(&foo); // And since the function is public, we can call the
40 2. Make the item public:
47 pub fn method(&self) {} // It's now public.