From 730fb12dabcdbc5ac52a636dd2cc3a73b4d55aac Mon Sep 17 00:00:00 2001 From: Jeff Date: Sat, 12 Feb 2022 08:13:43 -0500 Subject: [PATCH] chore(crawl): fix field type (#14) --- Cargo.toml | 2 +- README.md | 4 ++-- src/website.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8d2a660c5..c50c19b4e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "spider" -version = "1.3.0" +version = "1.3.1" authors = ["madeindjs "] description = "Multithreaded Web spider crawler written in Rust." repository = "https://github.com/madeindjs/spider" diff --git a/README.md b/README.md index 27f2038f7..8f481b219 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Add this dependency to your _Cargo.toml_ file. ```toml [dependencies] -spider = "1.2.2" +spider = "1.3.1" ``` Then you'll be able to use library. Here is a simple example: @@ -55,7 +55,7 @@ website.configuration.verbose = true; // Defaults to false website.configuration.delay = 2000; // Defaults to 250 ms website.configuration.concurrency = 10; // Defaults to 4 website.configuration.user_agent = "myapp/version"; // Defaults to spider/x.y.z, where x.y.z is the library version -website.on_link_find_callback = |s| { println!("link target: {}", s); s } // Callback to run on each link find +website.on_link_find_callback = |s| { println!("link target: {}", s); s }; // Callback to run on each link find website.crawl(); ``` diff --git a/src/website.rs b/src/website.rs index f46d53015..abfb6f0a0 100644 --- a/src/website.rs +++ b/src/website.rs @@ -29,7 +29,7 @@ pub struct Website<'a> { /// contains page visited pages: Vec, /// callback when a link is found - on_link_find_callback: fn(String) -> String, + pub on_link_find_callback: fn(String) -> String, /// Robot.txt parser holder robot_file_parser: RobotFileParser<'a>, }