Let me get this straight: Cargo has a command to install crates from crates.io but no command to update them...

Let me get this straight: Cargo has a command to install crates from crates.io but no command to update them? You have to first uninstall and then reinstall the crate? All because "we don't want to turn Cargo into a package manager"?

Attached: RustProgrammingLanguage_cover_0.png (473x625, 210K)

Other urls found in this thread:

github.com/rust-lang/crates.io-index`
doc.rust-lang.org/stable/book/
twitter.com/NSFWRedditImage

What? Last time I saw it I was sure that there were a "cargo update" command.

Only intended to be used when developing your own crate. Does not apply to binaries you build from crates.io.

BTFO by based git again!

Literally just update your cargo.toml file

Attached: 1550914262348.jpg (670x670, 37K)

This is why a language shouldnt make its own trashy version of git

What Cargo.toml file? There is none when you install binaries like ripgrep and fd-find. You just run "cargo install package_name" from your home directory and it places the binary in $HOME/.cargo/bin.
But you can't do cargo update package_name because the update command doesn't work like that. Am I supposed to go to .cargo/registry/src/.../package_name and run cargo update in that directory?

What the fuck is a .toml file? Did you retarded millennials invent yet another whitespace-delimited configuration format?

cargo install --list
some script to get the list of crates out of it
for crate in $(that script); do
cargo install --force $(crate)
done

Yep

absolute state

Attached: 5801103496400157c4274d87.png (512x415, 58K)

specify the version of the crate you want to use in cargo.toml and it will install it if that's not the version which is installed

cargo install --list | awk '/^[^ ]./{print $1}'

>you have to uninstall and reinstall
w h a t
all the dependencies are automatically acquired if they're missing, and you get the version you define in the package file, what the fuck are you on about user

Why would you do that? Rust has no defined stable ABI and updating libraries will break the rust programs?

You can install systemwide binaries with Cargo and I assume that's what OP is talking about.

Jees, whats going on.

Toml has been around for ages, my dude
I prefer yaml, but toml is a fine choice for configuration

ABI is rather irrelevant when Rust doesn't support dynamic linking.

>page 21 of your book.....
Updating a Crate to Get a New Version
When you do want to update a crate, Cargo provides another command,
update, which will ignore the Cargo.lock file and figure out all the latest versions
that fit your specifications in Cargo.toml. If that works, Cargo will write
those versions to the Cargo.lock file.
But by default, Cargo will only look for versions larger than 0.3.0 and
smaller than 0.4.0. If the rand crate has released two new versions, 0.3.15
and 0.4.0, you would see the following if you ran cargo update:
$ cargo update
Updating registry `github.com/rust-lang/crates.io-index`
Updating rand v0.3.14 -> v0.3.15
At this point, you would also notice a change in your Cargo.lock file noting
that the version of the rand crate you are now using is 0.3.15.
If you wanted to use rand version 0.4.0 or any version in the 0.4.x series,
you’d have to update the Cargo.toml file to look like this instead:
[dependencies]
rand = "0.4.0"
The next time you run cargo build, Cargo will update the registry of
crates available and reevaluate your rand requirements according to the
new version you have specified.
There’s a lot more to say about Cargo and its ecosystem which we’ll discuss
in Chapter 14, but for now, that’s all you need to know. Cargo makes it
very easy to reuse libraries, so Rustaceans are able to write smaller projects
that are assembled from a number of packages.

There is also a free version of the book here:
doc.rust-lang.org/stable/book/
and the relevant section you want is in chapter 2.
Read the book!

Attached: 1532023747462.png (1200x1200, 1.22M)

just use --force. ez

Yes, literally. For no fucking reason.

LMAO who uses Rust for real

It's like .ini but more specified (no implementation-defined quirks) and has types.

You can't spell cope without C.

You can't spell frustration without rust.

good thing I'm not frustrated
(also, the saying is "you can't spell trust without rust", user)

installing rust should generate a cargo.toml i thought

Why, any C++ programmer should learn Rust to better understand C++

man, that is one incredibly cute crab

yeah rust kills a shit load of bad habits from C++. as my rust improves so does my C++ its been a real trip. I use both but to be honest rust has really won me over for the most part. The whole rust ecosystem is VERY easy to use. I've heard the Async stuff is still kinda iffy but I havent messed with it too much yet.

Zoomers reinventing INI files

>Any heterosexual man should suck dick to better understand women

>yeah rust kills a shit load of bad habits from C++
Give examples you Rust shill

it straightens out the fucking mess they call rvalue and lvalue and fucking copy and move semantics

rust does literally nothing new, except just one thing - to enforce these semantics at the compiler level, or, if you wish, augment the type system with visibility and lifetime constraints

that is it

when you are getting old this becomes not so bad idea

It has been around for 6 years and hasn't reached version 1.0 yet

It does have dynamic linking but cargo prefers static by default. Why does Jow Forums relentlessly spread fake news about rust?

Attached: 1548661388812.png (1172x796, 152K)