After a lot of scattered reading here-and-there, I am now going through my shiny new “The Rust Programming Language” book carefully, making sure I can make the examples all work, after typing them with my own fingers (instead of “Yeah, that looks sensible.” and moving on). Helps to play with them, see if I can get my variations to work, too. (Having running code to play with is so valuable.)
I was doing great until I hit the example code that sits between examples 10-13 and 10-14. After carefully telling me to put the trait and impl code in src/lib.rs, the unnumbered example doesn’t say where I am expected to put it, nor how I would get the compiler to find it in said location.
Seems this example assumes I understand the material from Chapter 7 better than I do…
-kb, the Kent who tried to ask on Twitter, hoping it was a stupid question, easily answered with the canonical link for this question, but who was assured it is more than 280-characters worth.