Skip to content

Commit

Permalink
fix spelling mistake 'Unsed' -> 'Unused'
Browse files Browse the repository at this point in the history
  • Loading branch information
walkingeyerobot committed Jan 21, 2025
1 parent 32e52ca commit a4e5cc0
Showing 1 changed file with 5 additions and 5 deletions.
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

0 comments on commit a4e5cc0

Please sign in to comment.