mcc,
@mcc@mastodon.social avatar

I wish Cargo (Rust) would let you mark a Feature as "internal" and then not expose it directly or mark it different or something when listing enabled Features in the CLI. This program has two Features, "speed-debug-visual" and "speed-debug-serial". They both rely on a third Feature, "speed-debug-internal", but speed-debug-internal does nothing but provide support guts for the other two Features and there's no reason to turn it on by itself, it's just there to be a dependency for the other two

mcc,
@mcc@mastodon.social avatar

This problem is exacerbated by the fact that although cargo doc is very good at scooping up most important comments, there's still no formal way for cargo doc to get documentation of the Features. So many published crates forget to document their Features altogether, and you're left to figure out which Features are viable options from the +++- printout in cargo add, except usually that's like three user-exposed ones and five that only matter if you're developing the crate itself

kornel,
@kornel@mastodon.social avatar

@mcc There's informal convention that __-prefixed features are internal. Docs.rs and Lib.rs won't show them.

mcc,
@mcc@mastodon.social avatar

@kornel (Also: Is that two underscores? Is this convention informally documented anywhere?)

kornel,
@kornel@mastodon.social avatar

@mcc Single underscore works too, although crates generally use two underscores.

It's not documented.

https://github.com/rust-lang/docs.rs/blob/37fa77264f3b08dff432c082cbd412361d89245c/src/db/types.rs#L17

Not in Cargo yet:

https://github.com/rust-lang/cargo/issues/10794

mcc,
@mcc@mastodon.social avatar

@kornel I was just thinking elsewhere "_" is convention for "unused" and "__" is convention for "interal" so I'd probably use __.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • DreamBathrooms
  • ngwrru68w68
  • cubers
  • magazineikmin
  • thenastyranch
  • rosin
  • khanakhh
  • InstantRegret
  • Youngstown
  • slotface
  • Durango
  • kavyap
  • mdbf
  • tacticalgear
  • JUstTest
  • osvaldo12
  • normalnudes
  • tester
  • cisconetworking
  • everett
  • GTA5RPClips
  • ethstaker
  • anitta
  • Leos
  • provamag3
  • modclub
  • megavids
  • lostlight
  • All magazines