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"
2222atty = " 0.2"
2323bytesize = " 1.0"
2424cargo-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 " }
2626crossbeam-utils = " 0.8"
2727crypto-hash = " 0.3.1"
2828curl = { version = " 0.4.23" , features = [" http2" ] }
Original file line number Diff line number Diff line change 11[package ]
22name = " crates-io"
3- version = " 0.31.1 "
3+ version = " 0.33.0 "
44edition = " 2018"
55authors = [" Alex Crichton <alex@alexcrichton.com>" ]
66license = " MIT OR Apache-2.0"
Original file line number Diff line number Diff line change @@ -122,10 +122,19 @@ struct Crates {
122122 meta : TotalCrates ,
123123}
124124impl 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+ /// ```
129138 pub fn new_handle ( host : String , token : Option < String > , handle : Easy ) -> Registry {
130139 Registry {
131140 host,
You can’t perform that action at this time.
0 commit comments