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

Document Gen::size #255

Merged
merged 1 commit into from
Jan 22, 2020
Merged

Document Gen::size #255

merged 1 commit into from
Jan 22, 2020

Conversation

enterprisey
Copy link
Contributor

Gen::size() (really, the size parameter) is described in the docs for StdGen and StdThreadGen, but not in the docs for Gen. So, I copied and pasted the description to the docs for Gen.

I considered moving the paragraph to Gen's docs outright and having StdGen & StdThreadGen link to the new location, but I couldn't find a way to link directly to the size function (and the point of this PR is to reduce how much users need to hunt around, anyway).

I also considered linking "default size" in QuickCheck::new to the new documentation in Gen::size because it might be unclear what that means, but the house style of the docs seems to recommend not including internal links (maybe waiting for intra-rustdoc links?), so I didn't add any.

Copy link
Owner

@BurntSushi BurntSushi left a comment

Choose a reason for hiding this comment

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

Thanks!

/// Returns the `size` parameter used by this `Gen`, which controls the size
/// of random values generated. For example, it specifies the maximum length
/// of a randomly generated vector and also will specify the maximum
/// magnitude of a randomly generated number.
Copy link
Owner

Choose a reason for hiding this comment

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

Just so you're aware, it looks like the latter part of this sentence will be changed once #240 is merged (and this will be considered a breaking change). But this is correct as of today!

@BurntSushi BurntSushi merged commit 4a300c5 into BurntSushi:master Jan 22, 2020
@BurntSushi
Copy link
Owner

BurntSushi commented Jan 22, 2020

Also, with respect to internal links, the norm is to just write [TheType](struct.TheType.html) or [SomeTrait::some_method](trait.SomeTrait.html#tymethod.some_method). It's a bit annoying though, and yeah, I think many of us are holding out hope for intra-rustdoc links!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants