Closed olivren closed 7 years ago
Hey, thanks for your feedback, Oliver! You're right, the code is totally confusing.
I think I'll change it to something like
let p: OpenPackage = Package::new()
let p: OpenPackage = package.insert([stuff, padding, padding]);
let p: ClosedPackage = package.seal_up();
and so on.
Am 01.02.2017 um 16:13 schrieb Olivier Renaud notifications@github.com:
In this nice write-up, the following code example bothers me:
let package = Package::new(); // -> OpenPackage
package. insert([stuff, padding, padding]); // -> OpenPackage
package. seal_up(); // -> ClosedPackage // package.insert([more_stuff]); // ERROR: No method
insert
onClosedPackage
package. send(address, postage); // -> DeliveryTracking I don't see how the package type could change from one line to another. I think a realistic example would be:
let package = Package::new(); // -> OpenPackage let package = package.insert([stuff, padding, padding]); // -> OpenPackage let package = package.seal_up(); // -> ClosedPackage // let package = package.insert([more_stuff]); // ERROR: No method
insert
onClosedPackage
let package = package.send(address, postage); // -> DeliveryTracking — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
In this nice write-up, the following code example bothers me:
I don't see how the
package
type could change from one line to another. I think a realistic example would be: