doc: Improve example of using the links field#10728
Conversation
clearer example
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @ehuss (or someone else) soon. Please see the contribution instructions for more information. |
| links = "foo" | ||
| # this package links with a native library called "git2", e.g. "libgit2.a" on Linux | ||
| links = "git2" | ||
| ``` |
There was a problem hiding this comment.
Nit: I think I'd prefer to instead say
For example, to link against the native library `git2` (e.g. `libgit2.a` on Linux):
```toml
```
- It makes the example more directly related to what an end-user will do
- It doesn't unintentionally reinforce to users to repeat what they are commenting about in comments
There was a problem hiding this comment.
Putting the note outside of the TOML sounds good (also for consistency with the rest of the examples).
I would caution on the exact wording, as saying "to link against…" might be misleading since adding links doesn't actually cause a library to be linked. I would lean more towards the proposed text ("this package links with a…"), or maybe a slight modification like "links indicates that the package links with a …".
There was a problem hiding this comment.
OK, I have revised this a bit. It now says
For example, a crate that links a native library called "git2" (e.g. `libgit2.a`
on Linux) may specify:
```toml
links = "git2"
```
Remove comment from example toml to prose.
|
Thanks! @bors r+ |
|
📌 Commit c586652 has been approved by |
|
☀️ Test successful - checks-actions |
4 commits in 4d92f07f34ba7fb7d7f207564942508f46c225d3..8d42b0e8794ce3787c9f7d6d88b02ae80ebe8d19 2022-06-10 01:11:04 +0000 to 2022-06-17 16:46:26 +0000 - Use specific terminology for sparse HTTP-based registry (rust-lang/cargo#10764) - chore: Upgrade to clap 3.2 (rust-lang/cargo#10753) - Improve testing framework for http registries (rust-lang/cargo#10738) - doc: Improve example of using the links field (rust-lang/cargo#10728)
Update cargo 4 commits in 4d92f07f34ba7fb7d7f207564942508f46c225d3..8d42b0e8794ce3787c9f7d6d88b02ae80ebe8d19 2022-06-10 01:11:04 +0000 to 2022-06-17 16:46:26 +0000 - Use specific terminology for sparse HTTP-based registry (rust-lang/cargo#10764) - chore: Upgrade to clap 3.2 (rust-lang/cargo#10753) - Improve testing framework for http registries (rust-lang/cargo#10738) - doc: Improve example of using the links field (rust-lang/cargo#10728)
Update cargo 4 commits in 4d92f07f34ba7fb7d7f207564942508f46c225d3..8d42b0e8794ce3787c9f7d6d88b02ae80ebe8d19 2022-06-10 01:11:04 +0000 to 2022-06-17 16:46:26 +0000 - Use specific terminology for sparse HTTP-based registry (rust-lang/cargo#10764) - chore: Upgrade to clap 3.2 (rust-lang/cargo#10753) - Improve testing framework for http registries (rust-lang/cargo#10738) - doc: Improve example of using the links field (rust-lang/cargo#10728)
Update cargo 4 commits in 4d92f07f34ba7fb7d7f207564942508f46c225d3..8d42b0e8794ce3787c9f7d6d88b02ae80ebe8d19 2022-06-10 01:11:04 +0000 to 2022-06-17 16:46:26 +0000 - Use specific terminology for sparse HTTP-based registry (rust-lang/cargo#10764) - chore: Upgrade to clap 3.2 (rust-lang/cargo#10753) - Improve testing framework for http registries (rust-lang/cargo#10738) - doc: Improve example of using the links field (rust-lang/cargo#10728)
"foo"doesn't really help say what this is.