Tidy up. Also fixed "select-badge".

This commit is contained in:
Steven 2017-06-03 22:10:14 +01:00
parent 4d703498a8
commit d4807dd039

View file

@ -847,7 +847,7 @@ extern crate select;
use std::io::Read; use std::io::Read;
use select::document::Document; use select::document::Document;
use select::predicate::Name; use select::predicate::Name;
#
# error_chain! { # error_chain! {
# foreign_links { # foreign_links {
# ReqError(reqwest::Error); # ReqError(reqwest::Error);
@ -880,7 +880,7 @@ fn run() -> Result<()> {
Use [`reqwest::get`] to perform a HTTP GET request and then read the contents of the response into a buffer. Use [`reqwest::get`] to perform a HTTP GET request and then read the contents of the response into a buffer.
[`Document::from`] is then used to parse the string into a HTML document. We can then retrieve all the links from [`Document::from`] is then used to parse the string into a HTML document. We can then retrieve all the links from
the document by using [`find`] with the criteria of [`Name`] being "a". This returns a [`Selection`] that we [`filter_map`] the document by using [`find`] with the criteria of the [`Name`] being "a". This returns a [`Selection`] that we [`filter_map`]
on to retrieve the urls from links that have the "href" [`attr`]. on to retrieve the urls from links that have the "href" [`attr`].
<!-- Categories --> <!-- Categories -->
@ -899,6 +899,7 @@ on to retrieve the urls from links that have the "href" [`attr`].
[reqwest-badge]: https://badge-cache.kominick.com/crates/v/reqwest.svg?label=reqwest [reqwest-badge]: https://badge-cache.kominick.com/crates/v/reqwest.svg?label=reqwest
[reqwest]: https://docs.rs/reqwest/ [reqwest]: https://docs.rs/reqwest/
[select]: https://docs.rs/select/ [select]: https://docs.rs/select/
[select-badge]: https://badge-cache.kominick.com/crates/v/reqwest.svg?label=select
[serde-badge]: https://badge-cache.kominick.com/crates/v/serde.svg?label=serde [serde-badge]: https://badge-cache.kominick.com/crates/v/serde.svg?label=serde
[serde]: https://docs.rs/serde/ [serde]: https://docs.rs/serde/
[std]: https://doc.rust-lang.org/std [std]: https://doc.rust-lang.org/std