-
Notifications
You must be signed in to change notification settings - Fork 13k
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
more useful rustpkg init #10651
more useful rustpkg init #10651
Conversation
FWIW, |
(Also, how rustpkg runs tests is still undecided (#9003), so I think it'd be better to not "promote" the current sub-par situation by having it generated by default.) |
@huonw could you please elaborate the testing behaviour or point me to some materials on it? I'm asking because with that layout, I can still run |
@mrordinaire I don't know any more than listed on #9003, but, an example: lib.rs: use foo::useful;
pub mod foo;
pub fn more_useful() { useful() } foo.rs pub fn useful() {} test.rs mod lib; The So what I'm saying is we shouldn't be dictating a testing structure until #9003 is solved, i.e. don't create a default |
I've thought the bin/build/lib directories are for workspaces, not for source directories (aka git repos). |
@klutzy isn't the point of |
@huonw Ah right, I was wrong. |
I'm -1 on this patch as is.
|
@huonw Thank you for the clarification. I tried it and it really didn't work. |
Closing this temporarily in an attempt to un-stick bors. |
Hm, it appears that bors does not like this pull request, would you mind reopening again? Bors normally has no problems with fresh pull requests. |
@alexcrichton done. The new PR is now #10760 |
Sorry about that, but thanks! |
Add size-parameter to unecessary_box_returns Fixes rust-lang#10641 This adds a configuration-knob to the `unecessary_box_returns`-lint which allows _not_ linting a `fn() -> Box<T>` if `T` is "large". The default byte size above which we no longer lint is 128 bytes (due to rust-lang/rust-clippy#4652 (comment), also used in rust-lang#9373). The overall rational is given in rust-lang#10641. --- changelog: Enhancement: [`unnecessary_box_returns`]: Added new lint configuration `unnecessary-box-size` to set the maximum size of `T` in `Box<T>` to be linted [rust-lang#10651](rust-lang/rust-clippy#10651) <!-- changelog_checked -->
This PR modifies the behavior of
rustpkg init
.rustpkg init
now accepts two more arguments, the first is the type of package to initialize (bin
orlib
), and the second is the package name. Instead of initializing a workspace in the current directory,rustpkg init
now initializes a workspace under the directory with the same name as the supplied package name. In addition, it also creates some default crates (i.e.lib.rs
ormain.rs
) undersrc/<package-name>/
.E.g.
rustpkg init lib awesome_lib
will create the following directory tree in the current directory.The content of
lib.rs
is the following.EDIT:
test.rs
is no longer generated.