-
Notifications
You must be signed in to change notification settings - Fork 944
Renames #1237
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
Renames #1237
Conversation
@@ -118,6 +123,28 @@ impl Manifest { | |||
result | |||
} | |||
|
|||
fn table_to_renames(mut table: toml::Table, path: &str) -> Result<HashMap<String, String>> { | |||
let mut result = HashMap::new(); | |||
let rename_table = try!(get_table(&mut table, "rename", path)); |
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.
I think this means that this'll fail if rename
isn't present, right?
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.
No, if there is no table get_table
returns Ok(toml::Table::new())
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.
Ok great!
|
||
for (k, v) in rename_table { | ||
if let toml::Value::Table(mut t) = v { | ||
result.insert(k.to_owned(), get_string(&mut t, "to", path)?); |
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.
How come the level of indirection here? Why not:
[rename]
cargo-old = 'cargo'
(etc)
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.
I was basically following the convention for pkg
, I also thought it was a little bit more clear, but I'm not attached to the current format, if you'd prefer to change.
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.
Ok sounds good to me!
Looking good! Could this also add a The two cases I'm thinking about are:
|
Tests added! |
@bors: r+ |
📌 Commit dea6e4b has been approved by |
Renames This adds a `renames` section to the manifest. The idea is that we will add a rename from `rls` to `rls-preview` at the same time as renaming the rls component to rls-preview. This new feature will cause all existing users of the rls to have that component renamed to rls-preview. When the rls hits 1.0 we'll change the rename from `rls-preview` to `rls` and then everyone who already has the rls will be moved to the 1.0 name. Likewise for rustfmt, etc. r? @alexcrichton
💔 Test failed - status-travis |
@bors: r=alexcrichton |
@nrc: 🔑 Insufficient privileges: Not in reviewers |
@bors: r=alexcrichton |
@nrc: 🔑 Insufficient privileges: Not in reviewers |
@bors: r=alexcrichton |
📌 Commit 2f02956 has been approved by |
Renames This adds a `renames` section to the manifest. The idea is that we will add a rename from `rls` to `rls-preview` at the same time as renaming the rls component to rls-preview. This new feature will cause all existing users of the rls to have that component renamed to rls-preview. When the rls hits 1.0 we'll change the rename from `rls-preview` to `rls` and then everyone who already has the rls will be moved to the 1.0 name. Likewise for rustfmt, etc. r? @alexcrichton
💔 Test failed - status-travis |
@bors: retry |
@nrc: 🔑 Insufficient privileges: and not in try users |
@bors: retry |
Renames This adds a `renames` section to the manifest. The idea is that we will add a rename from `rls` to `rls-preview` at the same time as renaming the rls component to rls-preview. This new feature will cause all existing users of the rls to have that component renamed to rls-preview. When the rls hits 1.0 we'll change the rename from `rls-preview` to `rls` and then everyone who already has the rls will be moved to the 1.0 name. Likewise for rustfmt, etc. r? @alexcrichton
☀️ Test successful - status-appveyor, status-travis |
This adds a
renames
section to the manifest. The idea is that we will add a rename fromrls
torls-preview
at the same time as renaming the rls component to rls-preview. This new feature will cause all existing users of the rls to have that component renamed to rls-preview. When the rls hits 1.0 we'll change the rename fromrls-preview
torls
and then everyone who already has the rls will be moved to the 1.0 name. Likewise for rustfmt, etc.r? @alexcrichton