|
| 1 | +//! `Cargo.toml` / Manifest schema definition |
| 2 | +//! |
| 3 | +//! ## Style |
| 4 | +//! |
| 5 | +//! - Keys that exist for bookkeeping but don't correspond to the schema have a `_` prefix |
| 6 | +
|
1 | 7 | use std::collections::BTreeMap;
|
2 | 8 | use std::fmt::{self, Display, Write};
|
3 | 9 | use std::path::PathBuf;
|
@@ -108,7 +114,7 @@ pub struct InheritableFields {
|
108 | 114 | // We use skip here since it will never be present when deserializing
|
109 | 115 | // and we don't want it present when serializing
|
110 | 116 | #[serde(skip)]
|
111 |
| - pub ws_root: PathBuf, |
| 117 | + pub _ws_root: PathBuf, |
112 | 118 | }
|
113 | 119 |
|
114 | 120 | /// Represents the `package`/`project` sections of a `Cargo.toml`.
|
@@ -430,7 +436,7 @@ impl MaybeWorkspaceDependency {
|
430 | 436 | pub fn unused_keys(&self) -> Vec<String> {
|
431 | 437 | match self {
|
432 | 438 | MaybeWorkspaceDependency::Defined(d) => d.unused_keys(),
|
433 |
| - MaybeWorkspaceDependency::Workspace(w) => w.unused_keys.keys().cloned().collect(), |
| 439 | + MaybeWorkspaceDependency::Workspace(w) => w._unused_keys.keys().cloned().collect(), |
434 | 440 | }
|
435 | 441 | }
|
436 | 442 | }
|
@@ -471,7 +477,7 @@ pub struct TomlWorkspaceDependency {
|
471 | 477 | /// This is here to provide a way to see the "unused manifest keys" when deserializing
|
472 | 478 | #[serde(skip_serializing)]
|
473 | 479 | #[serde(flatten)]
|
474 |
| - pub unused_keys: BTreeMap<String, toml::Value>, |
| 480 | + pub _unused_keys: BTreeMap<String, toml::Value>, |
475 | 481 | }
|
476 | 482 |
|
477 | 483 | impl TomlWorkspaceDependency {
|
@@ -510,7 +516,7 @@ impl TomlDependency {
|
510 | 516 | pub fn unused_keys(&self) -> Vec<String> {
|
511 | 517 | match self {
|
512 | 518 | TomlDependency::Simple(_) => vec![],
|
513 |
| - TomlDependency::Detailed(detailed) => detailed.unused_keys.keys().cloned().collect(), |
| 519 | + TomlDependency::Detailed(detailed) => detailed._unused_keys.keys().cloned().collect(), |
514 | 520 | }
|
515 | 521 | }
|
516 | 522 | }
|
@@ -568,7 +574,7 @@ pub struct DetailedTomlDependency<P: Clone = String> {
|
568 | 574 | /// This is here to provide a way to see the "unused manifest keys" when deserializing
|
569 | 575 | #[serde(skip_serializing)]
|
570 | 576 | #[serde(flatten)]
|
571 |
| - pub unused_keys: BTreeMap<String, toml::Value>, |
| 577 | + pub _unused_keys: BTreeMap<String, toml::Value>, |
572 | 578 | }
|
573 | 579 |
|
574 | 580 | impl<P: Clone> DetailedTomlDependency<P> {
|
@@ -598,7 +604,7 @@ impl<P: Clone> Default for DetailedTomlDependency<P> {
|
598 | 604 | artifact: Default::default(),
|
599 | 605 | lib: Default::default(),
|
600 | 606 | target: Default::default(),
|
601 |
| - unused_keys: Default::default(), |
| 607 | + _unused_keys: Default::default(), |
602 | 608 | }
|
603 | 609 | }
|
604 | 610 | }
|
|
0 commit comments