File tree Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Expand file tree Collapse file tree 3 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ path = "src/cargo/lib.rs"
22
22
atty = " 0.2"
23
23
bytesize = " 1.0"
24
24
cargo-platform = { path = " crates/cargo-platform" , version = " 0.1.1" }
25
- crates-io = { path = " crates/crates-io" , version = " 0.31.1 " }
25
+ crates-io = { path = " crates/crates-io" , version = " 0.33.0 " }
26
26
crossbeam-utils = " 0.8"
27
27
crypto-hash = " 0.3.1"
28
28
curl = { version = " 0.4.23" , features = [" http2" ] }
Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " crates-io"
3
- version = " 0.31.1 "
3
+ version = " 0.33.0 "
4
4
edition = " 2018"
5
5
authors = [
" Alex Crichton <[email protected] >" ]
6
6
license = " MIT OR Apache-2.0"
Original file line number Diff line number Diff line change @@ -122,10 +122,19 @@ struct Crates {
122
122
meta : TotalCrates ,
123
123
}
124
124
impl Registry {
125
- pub fn new ( host : String , token : Option < String > ) -> Registry {
126
- Registry :: new_handle ( host, token, Easy :: new ( ) )
127
- }
128
-
125
+ /// Creates a new `Registry`.
126
+ ///
127
+ /// ## Example
128
+ ///
129
+ /// ```rust
130
+ /// use curl::easy::Easy;
131
+ /// use crates_io::Registry;
132
+ ///
133
+ /// let mut handle = Easy::new();
134
+ /// // If connecting to crates.io, a user-agent is required.
135
+ /// handle.useragent("my_crawler (example.com/info)");
136
+ /// let mut reg = Registry::new_handle(String::from("https://crates.io"), None, handle);
137
+ /// ```
129
138
pub fn new_handle ( host : String , token : Option < String > , handle : Easy ) -> Registry {
130
139
Registry {
131
140
host,
You can’t perform that action at this time.
0 commit comments