@@ -131,18 +131,18 @@ use url::Url;
131
131
/// The `Cargo.lock` structure.
132
132
#[ derive( Serialize , Deserialize , Debug ) ]
133
133
pub struct EncodableResolve {
134
- version : Option < u32 > ,
135
- package : Option < Vec < EncodableDependency > > ,
134
+ pub version : Option < u32 > ,
135
+ pub package : Option < Vec < EncodableDependency > > ,
136
136
/// `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 > ,
139
139
#[ serde( default , skip_serializing_if = "Patch::is_empty" ) ]
140
- patch : Patch ,
140
+ pub patch : Patch ,
141
141
}
142
142
143
143
#[ derive( Serialize , Deserialize , Debug , Default ) ]
144
- struct Patch {
145
- unused : Vec < EncodableDependency > ,
144
+ pub struct Patch {
145
+ pub unused : Vec < EncodableDependency > ,
146
146
}
147
147
148
148
pub type Metadata = BTreeMap < String , String > ;
@@ -531,12 +531,12 @@ impl Patch {
531
531
532
532
#[ derive( Serialize , Deserialize , Debug , PartialOrd , Ord , PartialEq , Eq ) ]
533
533
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 > ,
540
540
}
541
541
542
542
#[ derive( Debug , Clone ) ]
@@ -550,7 +550,7 @@ pub struct EncodableSourceId {
550
550
}
551
551
552
552
impl EncodableSourceId {
553
- fn new ( source : String ) -> CargoResult < Self > {
553
+ pub fn new ( source : String ) -> CargoResult < Self > {
554
554
let source_str = source. clone ( ) ;
555
555
let ( kind, url) = source
556
556
. split_once ( '+' )
@@ -589,7 +589,7 @@ impl EncodableSourceId {
589
589
& self . source_str
590
590
}
591
591
592
- fn as_url ( & self ) -> impl fmt:: Display + ' _ {
592
+ pub fn as_url ( & self ) -> impl fmt:: Display + ' _ {
593
593
self . source_str . clone ( )
594
594
}
595
595
}
@@ -644,9 +644,9 @@ impl Ord for EncodableSourceId {
644
644
645
645
#[ derive( Debug , PartialOrd , Ord , PartialEq , Eq , Hash , Clone ) ]
646
646
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 > ,
650
650
}
651
651
652
652
impl fmt:: Display for EncodablePackageId {
0 commit comments