Skip to content

Commit 6ed05ec

Browse files
committed
fixing doc.rs issues
1 parent 40f52bc commit 6ed05ec

File tree

8 files changed

+14
-26
lines changed

8 files changed

+14
-26
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "nano-get"
33
description = """
44
A very tiny implementation of HTTP(s) GET, using minimal dependencies.
55
"""
6-
version = "0.2.2"
6+
version = "0.2.3"
77
authors = ["Rahul Thomas <rapidclock@users.noreply.github.com>"]
88
edition = "2018"
99
license = "MIT"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ A tiny implementation of HTTP GET using only the standard library by default.
66

77
If you require `https`, please enable the `"https"` feature flag like:
88
```
9-
nano-get = { version = "0.2.2", features = ["https"] }
9+
nano-get = { version = "0.2.3", features = ["https"] }
1010
```
1111

1212
Enabling the `https` flag, uses the rust [openssl](https://crates.io/crates/openssl) crate.
@@ -120,7 +120,7 @@ This is also not meant to be demonstrative of idiomatic uses of the async librar
120120
**Cargo.toml snippet**
121121
```toml
122122
[dependencies]
123-
nano-get = {version = "0.2.2", features = ["https"] }
123+
nano-get = {version = "0.2.3", features = ["https"] }
124124
tokio = { version = "0.2.6", features = ["rt-threaded"] }
125125
futures = "0.3.1"
126126
```

src/errors.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,8 @@ impl std::fmt::Display for NanoGetError {
2222
}
2323
}
2424

25-
//impl From for NanoGetError {
26-
// fn from(err: std::io::Error) -> Self {
27-
//
28-
// }
29-
//}
30-
3125
impl NanoGetError {
3226
pub fn new(kind: ErrorKind) -> Self {
33-
NanoGetError {kind}
27+
NanoGetError { kind }
3428
}
35-
}
36-
37-
38-
//pub type Result<T> = std::result::Result<T, NanoGetError>;
29+
}

src/https.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@ extern crate openssl;
33

44
use std::net::TcpStream;
55

6-
use openssl::ssl::{SslConnector, SslMethod};
6+
use openssl::ssl::{SslConnector, SslMethod, SslStream};
77

88
use super::{Request, Response, ToUrl, Url};
9-
use super::http;
10-
11-
use openssl::ssl::SslStream;
129
use super::errors::NanoGetError;
10+
use super::http;
1311

1412
/// The implementation of HTTPS GET using OpenSSL.
1513
///

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@
6969
//! ```
7070
//!
7171
//! For details, check the `Request` and `Response` structure documentation.
72-
7372
pub use http::get_http;
7473
#[cfg(feature = "https")]
7574
pub use https::get_https;

src/request.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
use std::collections::HashMap;
22
use std::error::Error;
33

4+
use super::{ToUrl, Url};
45
use super::errors::NanoGetError;
56
use super::http::request_http_get;
7+
#[cfg(feature = "https")]
68
use super::https::request_https_get;
79
use super::Response;
810

9-
use super::{ToUrl, Url};
10-
1111
/// This is the basic HTTP Request Object.
1212
///
1313
/// This is self-containing and you can execute the request using its execute method.

src/response.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::collections::HashMap;
2-
use std::fmt::{Display, Formatter, Error};
3-
use super::url::Tuple;
2+
use std::fmt::{Display, Error, Formatter};
43

4+
use super::url::Tuple;
55

66
/// This is the HTTP Reponse Object.
77
///
@@ -81,7 +81,7 @@ fn process_head_lines(lines: Vec<&str>) -> (ResponseStatus, Option<HashMap<Strin
8181
}
8282

8383
fn process_response_headers(lines: &[&str]) -> Option<HashMap<String, String>> {
84-
return if lines.is_empty() {
84+
if lines.is_empty() {
8585
None
8686
} else {
8787
let mut headers = HashMap::new();

src/url/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
pub mod models;
1+
pub use self::models::{ToUrl, Tuple, Url};
22

3-
pub use self::models::{Url, ToUrl, Tuple};
3+
pub mod models;
44

55
pub fn parse_proto(s: String, default_proto: Option<String>) -> (String, String) {
66
let parts: Vec<&str> = s.split("://").collect();

0 commit comments

Comments
 (0)