Skip to content

add ability to use --bin and --lib together with cargo new and initΒ #10595

Open
@skewballfox

Description

@skewballfox

Problem

currently, cargo init some_project --lib --bin provides the following output:

error: can't specify both lib and binary outputs

Proposed Solution

have a third built in package template that takes a library-first approach

Notes

It seems there is a use-case for projects that are both a library and a binary. clone and compile: its a binary. add to your cargo manifest: it's a library. It also seems there is a right and wrong way to do it.

I think it would be useful to have a package template for library-first applications

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-initCommand-newS-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions