Hacker News new | ask | show | jobs
by dorfsmay 2444 days ago
I came up and added that functionality. I spent many years as a UNIX sysadmin, everything was a `man` page away, including C libraries. I've done a lot of python over the past 7 years and used `pydoc` constantly. The inspiration for this came from `pydoc`, I wanted to replicate specifically the ability to lookup a specific call on a library such as `pydoc file.readlines`, hence the ability to do `rustup doc std::fs::read_dir`.

The funny thing is that I am fairly junior at Rust, and started using that functionality early on when I was trying to implement it, and really missed it every time I broke it or had to re-installed the prod version of rustup!

This is said a lot, but the Rust community is truly welcoming and helpful, even as a newcomer to Rust I got a lot of help and guidance on this. If you have an idea for a new functionality or fix something, don't let your inexperience stop you, go on discord and discuss it, write a small proof of concept and do a PR asking for feedback.

1 comments

Two other things I discovered while working on this, which I find are not advertised enough (I added a mention about them to the RustBridge material):

• You can bring up a specific book with `rustup doc --book`, `rustup doc --embedded-book`, `rustup doc --nomicon` etc... (use `rustup doc -h` to see the list). Yes works offline too.

• It should obvious because it's right there, but I somehow totally missed it, and so did the few people I mentioneded it to since: There is either a search box or a symbol on every single `rustup doc` pages. It works really well and typically allow to find what you're looking for quickly. And yes, it too works offline!

Wow, this is great! It's nice to see this in a new/contemporary tool. I've caught myself mulling over taking a week at our cottage, working on some hobby project - only to realize that most of my "whe I find the time" To-do-list is crowded by various spa web stack stuff that I just know won't have an easy path to "pack what you need for a week of off line exploration" (when you don't already know enough what you'll need to look up, before you go offline to work..).

But now I can shift "do some stuff with Rust" higher up on that list, so thank you!

Ed: now the bad thing about lean core - fat ecosystem - and the great cargo - is of course that I will need to either "pack my expected dependencies", or just stick to the core... Which is great for learning, but kind of annoying if the plan isn't to write a database and a graphics library... But rather some kid of application. But we can't have everything.