Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: Improve example of using the links field #10728

Merged
merged 2 commits into from
Jun 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/doc/src/reference/manifest.md
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,13 @@ script guide.

[links]: build-scripts.md#the-links-manifest-key

For example, a crate that links a native library called "git2" (e.g. `libgit2.a`
on Linux) may specify:

```toml
[package]
# ...
links = "foo"
links = "git2"
```
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 …".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"
    ```


<a id="the-exclude-and-include-fields-optional"></a>
Expand Down