Skip to content

easier way to add crates in cargo #6457

@mrwanashraf

Description

@mrwanashraf

Describe the problem you are trying to solve

I'm new to rust and i came from javascript/nodejs background,
for me i use npm to install packages using npm install package_name.

as I was exploring rust i learnt about cargo and crates.io.
and i found that the way to install crates in cargo is through going to crates.io searching for the package then adding it manually to cargo.toml.
that takes lots of time when you wanna add crate(s) and therefore it impacts the developer's productivity.

Describe the solution you'd like

is it possible for this feature to be implemented in cargo as well?

to run a command like
cargo add crate_name
or
cargo install crate_name

then cargo fetches the crate_name version adds it to the cargo.toml file and finally adds the crate to the project?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions