Skip to content

Document Gen::size#255

Merged
BurntSushi merged 1 commit into
BurntSushi:masterfrom
enterprisey:master
Jan 22, 2020
Merged

Document Gen::size#255
BurntSushi merged 1 commit into
BurntSushi:masterfrom
enterprisey:master

Conversation

@enterprisey
Copy link
Copy Markdown
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
Copy Markdown
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!

Comment thread src/arbitrary.rs
/// 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
Copy Markdown
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
Copy Markdown
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