mirror of
https://github.com/rust-lang/cargo.git
synced 2025-10-01 11:30:39 +00:00
fix: wrong concat and field name (#15074)
### What does this PR try to resolve? Fixes a wrong concatenation in macro, and one wrong field name. ### How should we test and review this PR? `cargo doc --document-private-items --no-deps --open`
This commit is contained in:
commit
dc0d02a1fc
@ -869,7 +869,7 @@ fn inheritable_from_path(
|
|||||||
macro_rules! package_field_getter {
|
macro_rules! package_field_getter {
|
||||||
( $(($key:literal, $field:ident -> $ret:ty),)* ) => (
|
( $(($key:literal, $field:ident -> $ret:ty),)* ) => (
|
||||||
$(
|
$(
|
||||||
#[doc = concat!("Gets the field `workspace.package", $key, "`.")]
|
#[doc = concat!("Gets the field `workspace.package.", $key, "`.")]
|
||||||
fn $field(&self) -> CargoResult<$ret> {
|
fn $field(&self) -> CargoResult<$ret> {
|
||||||
let Some(val) = self.package.as_ref().and_then(|p| p.$field.as_ref()) else {
|
let Some(val) = self.package.as_ref().and_then(|p| p.$field.as_ref()) else {
|
||||||
bail!("`workspace.package.{}` was not defined", $key);
|
bail!("`workspace.package.{}` was not defined", $key);
|
||||||
@ -940,7 +940,7 @@ impl InheritableFields {
|
|||||||
Ok(dep)
|
Ok(dep)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Gets the field `workspace.lint`.
|
/// Gets the field `workspace.lints`.
|
||||||
pub fn lints(&self) -> CargoResult<manifest::TomlLints> {
|
pub fn lints(&self) -> CargoResult<manifest::TomlLints> {
|
||||||
let Some(val) = &self.lints else {
|
let Some(val) = &self.lints else {
|
||||||
bail!("`workspace.lints` was not defined");
|
bail!("`workspace.lints` was not defined");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user