Repository: astral-sh/uv
File: crates/uv-requirements/src/specification.rs (Rust)

Code before:
                    Ok(contents) => contents,
                    Err(err) if err.kind() == std::io::ErrorKind::NotFound => {
                        return Err(anyhow::anyhow!("File not found: `{}`", path.user_display()));
                    }
                    Err(err) => {
                        return Err(anyhow::anyhow!(
                            "Failed to read `{}`: {}",
                            path.user_display(),
                            err
                        ));
                    }
                };
                let _ = toml::from_str::<PyProjectToml>(&contents)
                    .with_context(|| format!("Failed to parse: `{}`", path.user_display()))?;

                Self {
                    source_trees: vec![path.clone()],
                    ..Self::default()
                }
            }
            RequirementsSource::Pep723Script(path) => {
                let script = match Pep723Script::read(&path).await {
                    Ok(Some(script)) => Pep723Item::Script(script),
                    Ok(None) => {
                        return Err(anyhow::anyhow!(
                            "`{}` does not contain an inline script metadata tag.",
                            path.user_display(),
                        ));
                    }
                    Err(Pep723Error::Io(err)) if err.kind() == std::io::ErrorKind::NotFound => {
                        return Err(anyhow::anyhow!(
                            "Failed to read `{}` (not found).",
                            path.user_display(),
                        ));
                    }
                    Err(err) => return Err(err.into()),
                };

                let metadata = script.metadata();

                let requirements = metadata
                    .dependencies
                    .as_ref()
                    .map(|dependencies| {
                        dependencies
                            .iter()
                            .map(|dependency| {
                                UnresolvedRequirementSpecification::from(Requirement::from(
                                    dependency.to_owned(),
                                ))
                            })

Review comment (suggestion):
```suggestion
                            "`{}` does not contain inline script metadata",
```
Just bike-shedding the message, but note we don't end with a period for single sentence errors..

Code after:
                    Ok(contents) => contents,
                    Err(err) if err.kind() == std::io::ErrorKind::NotFound => {
                        return Err(anyhow::anyhow!("File not found: `{}`", path.user_display()));
                    }
                    Err(err) => {
                        return Err(anyhow::anyhow!(
                            "Failed to read `{}`: {}",
                            path.user_display(),
                            err
                        ));
                    }
                };
                let _ = toml::from_str::<PyProjectToml>(&contents)
                    .with_context(|| format!("Failed to parse: `{}`", path.user_display()))?;

                Self {
                    source_trees: vec![path.clone()],
                    ..Self::default()
                }
            }
            RequirementsSource::Pep723Script(path) => {
                let script = match Pep723Script::read(&path).await {
                    Ok(Some(script)) => Pep723Item::Script(script),
                    Ok(None) => {
                        return Err(anyhow::anyhow!(
                            "`{}` does not contain inline script metadata",
                            path.user_display(),
                        ));
                    }
                    Err(Pep723Error::Io(err)) if err.kind() == std::io::ErrorKind::NotFound => {
                        return Err(anyhow::anyhow!(
                            "Failed to read `{}` (not found)",
                            path.user_display(),
                        ));
                    }
                    Err(err) => return Err(err.into()),
                };

                let metadata = script.metadata();

                let requirements = metadata
                    .dependencies
                    .as_ref()
                    .map(|dependencies| {
                        dependencies
                            .iter()
                            .map(|dependency| {
                                UnresolvedRequirementSpecification::from(Requirement::from(
                                    dependency.to_owned(),
                                ))
                            })