Function repackage::dot_crate [−][src]
pub fn dot_crate(
dot_crate: impl AsRef<Path>,
old_name: Option<&str>,
new_name: &str
) -> Result<()>
Repackage the crate contained in the .crate
tarball at dot_crate
as new_name
.
Pass in the old crate name to verify that the crate you are repackaging is in fact the one you
think it is. If you do not, it will be inferred from the name of the .crate
file. The old
name is needed one way or the other in order to also replace references to the crate inside
non-src/
.rs files.
The repackaged file will end up next to the current .crate
file with the crate name replaced
appropriately. In other words, if you are replacing foo
with bar
, and give the input file
baz/foo-0.1.0.crate
, the repackaged crate file will be baz/bar-0.1.0.crate
.