TIL that you *can* put inner doc comments inside functions in @rustlang. That makes me very happy! I'm not sure if it changed recently, or if I always assumed you couldn't because you can't do that with structs.
I'm talking about comments like these:
fn foo() {
//! doc
}
-
-
I wonder why we can't do it with structs? I very much prefer putting the documentation after the name of the thing being documented so reading top-to-bottom makes sense.
-
I don't think there's a technical reason for why we can't, we just don't parse inner attributes for anything but bodies. This could be RFCd.
- 3 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.