Skip to content

Commit 982ee85

Browse files
committed
refactor: make certain fields and methods public
1 parent ef7814f commit 982ee85

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

src/cargo/core/resolver/encode.rs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -131,18 +131,18 @@ use url::Url;
131131
/// The `Cargo.lock` structure.
132132
#[derive(Serialize, Deserialize, Debug)]
133133
pub struct EncodableResolve {
134-
version: Option<u32>,
135-
package: Option<Vec<EncodableDependency>>,
134+
pub version: Option<u32>,
135+
pub package: Option<Vec<EncodableDependency>>,
136136
/// `root` is optional to allow backward compatibility.
137-
root: Option<EncodableDependency>,
138-
metadata: Option<Metadata>,
137+
pub root: Option<EncodableDependency>,
138+
pub metadata: Option<Metadata>,
139139
#[serde(default, skip_serializing_if = "Patch::is_empty")]
140-
patch: Patch,
140+
pub patch: Patch,
141141
}
142142

143143
#[derive(Serialize, Deserialize, Debug, Default)]
144-
struct Patch {
145-
unused: Vec<EncodableDependency>,
144+
pub struct Patch {
145+
pub unused: Vec<EncodableDependency>,
146146
}
147147

148148
pub type Metadata = BTreeMap<String, String>;
@@ -531,12 +531,12 @@ impl Patch {
531531

532532
#[derive(Serialize, Deserialize, Debug, PartialOrd, Ord, PartialEq, Eq)]
533533
pub struct EncodableDependency {
534-
name: String,
535-
version: String,
536-
source: Option<EncodableSourceId>,
537-
checksum: Option<String>,
538-
dependencies: Option<Vec<EncodablePackageId>>,
539-
replace: Option<EncodablePackageId>,
534+
pub name: String,
535+
pub version: String,
536+
pub source: Option<EncodableSourceId>,
537+
pub checksum: Option<String>,
538+
pub dependencies: Option<Vec<EncodablePackageId>>,
539+
pub replace: Option<EncodablePackageId>,
540540
}
541541

542542
#[derive(Debug, Clone)]
@@ -550,7 +550,7 @@ pub struct EncodableSourceId {
550550
}
551551

552552
impl EncodableSourceId {
553-
fn new(source: String) -> CargoResult<Self> {
553+
pub fn new(source: String) -> CargoResult<Self> {
554554
let source_str = source.clone();
555555
let (kind, url) = source
556556
.split_once('+')
@@ -589,7 +589,7 @@ impl EncodableSourceId {
589589
&self.source_str
590590
}
591591

592-
fn as_url(&self) -> impl fmt::Display + '_ {
592+
pub fn as_url(&self) -> impl fmt::Display + '_ {
593593
self.source_str.clone()
594594
}
595595
}
@@ -644,9 +644,9 @@ impl Ord for EncodableSourceId {
644644

645645
#[derive(Debug, PartialOrd, Ord, PartialEq, Eq, Hash, Clone)]
646646
pub struct EncodablePackageId {
647-
name: String,
648-
version: Option<String>,
649-
source: Option<EncodableSourceId>,
647+
pub name: String,
648+
pub version: Option<String>,
649+
pub source: Option<EncodableSourceId>,
650650
}
651651

652652
impl fmt::Display for EncodablePackageId {

0 commit comments

Comments
 (0)