Search code examples
rustrust-cargo

Cargo init creates new dir as like cargo new


I have no idea why this acts the same in both cases

enter image description here

enter image description here


Solution

  • Found answer.

    • cargo init without args works as expected: creates files in current location.
    • cargo init with args acts like cargo new.

    EDIT

    Here is official cargo book example which demonstrate this topic.

    Create a binary Cargo package in the current directory: cargo init

    Create a binary Cargo package in the given directory: cargo new foo