Skip to content
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

fix spelling mistake 'Unsed' -> 'Unused' #1467

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/manifest/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ struct NpmData {
}

#[doc(hidden)]
pub struct ManifestAndUnsedKeys {
pub struct ManifestAndUnusedKeys {
pub manifest: CargoManifest,
pub unused_keys: BTreeSet<String>,
}
Expand Down Expand Up @@ -482,13 +482,13 @@ impl CrateData {
}

/// Read the `manifest_path` file and deserializes it using the toml Deserializer.
/// Returns a Result containing `ManifestAndUnsedKeys` which contains `CargoManifest`
/// Returns a Result containing `ManifestAndUnusedKeys` which contains `CargoManifest`
/// and a `BTreeSet<String>` containing the unused keys from the parsed file.
///
/// # Errors
/// Will return Err if the file (manifest_path) couldn't be read or
/// if deserialize to `CargoManifest` fails.
pub fn parse_crate_data(manifest_path: &Path) -> Result<ManifestAndUnsedKeys> {
pub fn parse_crate_data(manifest_path: &Path) -> Result<ManifestAndUnusedKeys> {
let manifest = fs::read_to_string(&manifest_path)
.with_context(|| anyhow!("failed to read: {}", manifest_path.display()))?;
let manifest = toml::Deserializer::new(&manifest);
Expand All @@ -508,15 +508,15 @@ impl CrateData {
})
.with_context(|| anyhow!("failed to parse manifest: {}", manifest_path.display()))?;

Ok(ManifestAndUnsedKeys {
Ok(ManifestAndUnusedKeys {
manifest,
unused_keys,
})
}

/// Iterating through all the passed `unused_keys` and output
/// a warning for each unknown key.
pub fn warn_for_unused_keys(manifest_and_keys: &ManifestAndUnsedKeys) {
pub fn warn_for_unused_keys(manifest_and_keys: &ManifestAndUnusedKeys) {
manifest_and_keys.unused_keys.iter().for_each(|path| {
PBAR.warn(&format!(
"\"{}\" is an unknown key and will be ignored. Please check your Cargo.toml.",
Expand Down
Loading