pub(super) fn add_link_to_set_of_links(
        &self,
        link: &str,
        links: &mut HashSet<String>,
    ) -> Result<()> {
        log::trace!("enter: add_link_to_set_of_links({}, {:?})", link, links);

        let old_url = match self.target {
            ExtractionTarget::ResponseBody => self.response.unwrap().url().clone(),
            ExtractionTarget::RobotsTxt => match Url::parse(&self.url) {
                Ok(u) => u,
                Err(e) => {
                    bail!("Could not parse {}: {}", self.url, e);
                }
            },
        };

        let new_url = old_url
            .join(link)
            .with_context(|| format!("Could not join {} with {}", old_url, link))?;

        links.insert(new_url.to_string());

        log::trace!("exit: add_link_to_set_of_links");

        Ok(())
    }
/// simple helper to stay DRY, trys to join a url + fragment and add it to the `links` HashSet
simple helper to stay DRY, trys to join a url + fragment and add it to the `links` HashSet
simple helper to stay DRY trys to join a url + fragment and add it to the ` links ` HashSet
pub(super) fn add_link_to_set_of_links(
        &self,
        link: &str,
        links: &mut HashSet<String>,
    ) -> Result<()> {
        log::trace!("enter: add_link_to_set_of_links({}, {:?})", link, links);
        let old_url = match self.target {
            ExtractionTarget::ResponseBody => self.response.unwrap().url().clone(),
            ExtractionTarget::RobotsTxt => match Url::parse(&self.url) {
                Ok(u) => u,
                Err(e) => {
                    bail!("Could not parse {}: {}", self.url, e);
                }
            },
        };
        let new_url = old_url
            .join(link)
            .with_context(|| format!("Could not join {} with {}", old_url, link))?;
        links.insert(new_url.to_string());
        log::trace!("exit: add_link_to_set_of_links");
        Ok(())
    }
pub ( super ) fn add_link_to_set_of_links ( & self , link : & str , links : & mut HashSet < String > , ) -> Result < ( ) > { log :: trace ! ( " " link links ) ; let old_url = match self . target { ExtractionTarget :: ResponseBody => self . response . unwrap ( ) . url ( ) . clone ( ) , ExtractionTarget :: RobotsTxt => match Url :: parse ( & self . url ) { Ok ( u ) => u , Err ( e ) => { bail ! ( " " self url e ) ; } } , } ; let new_url = old_url . join ( link ) . with_context ( | | format ! ( " " old_url link ) ) ? ; links . insert ( new_url . to_string ( ) ) ; log :: trace ! ( " " ) ; Ok ( ( ) ) }
simple helper to stay DRY, trys to join a url + fragment and add it to the `links` HashSet
simple helper to stay DRY trys to join a url + fragment and add it to the ` links ` HashSet
&self
link
&str
links
&mut HashSet<String>