-
Notifications
You must be signed in to change notification settings - Fork 144
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
Add the correct crate name (as in crates.io) to toml and notify user #98
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I think this is the expected behavior of cargo-add. I have not tried this locally and only read the code. Can you add integration tests for this?
.ok_or(FetchVersionError::CratesIo(CratesIoError::NotFound))); | ||
|
||
if name != crate_name { | ||
println!("WARN: Added {} instead of {}", name, crate_name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good reminder to add an actual logging facility some time soon (but not in this PR) :)
let v = format!("{prefix}{version}", | ||
prefix = self.get_upgrade_prefix().unwrap_or(""), | ||
version = try!(get_latest_version(&self.arg_crate))); | ||
dependency.set_version(&v) | ||
version = dep.version().unwrap_or_else(|| unreachable!())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment why you are sure this is actually always present and unreachable is fine here?
use std::path::Path; | ||
use rustc_serialize::json; | ||
use rustc_serialize::json::{BuilderError, Json}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove leading empty line
Done. |
…rcup New year, new bugfixes This is a rollup of #98 (which replaces #78), #99, and #100. @sebasgarcep and @sinkuu, thank you for your PRs! Do you have time to review this? I've add a few tests and changed to code slightly, before running Rustfmt and Clippy. Just to make sure Github gets all the references: Fixes #52 Fixes #88 Fixes #92
Resurrecting #78