Skip to content

Commit e4887bf

Browse files
authored
Update documentation for crate_name
The current version of crate_names returns a `Result<FoundCrate, Error>`. Update the docs to describe the potential success values and refer to the Error enum.
1 parent 5cd850c commit e4887bf

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/lib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,9 @@ type CrateNames = BTreeMap<String, FoundCrate>;
174174
///
175175
/// # Returns
176176
///
177-
/// - `Ok(orig_name)` if the crate was found, but not renamed in the `Cargo.toml`.
178-
/// - `Ok(RENAMED)` if the crate was found, but is renamed in the `Cargo.toml`. `RENAMED` will be
179-
/// the renamed name.
180-
/// - `Err` if an error occurred.
177+
/// - `Ok(FoundCrate::Itself)` the searched crate is the current crate being compiled.
178+
/// - `Ok(FoundCrate::Name(new_name))` the searched create was found with the given name Cargo.toml
179+
/// - `Err` if an error occurred. See [`Error`].
181180
///
182181
/// The returned crate name is sanitized in such a way that it is a valid rust identifier. Thus,
183182
/// it is ready to be used in `extern crate` as identifier.

0 commit comments

Comments
 (0)