Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

To me it's quite good for Rust as it usually suggests me some (unknown to me) borrow checker API that actually helps me either solve the issue at hand or at least point me in the right direction to figure what is actually wrong with my code and it doesn't compile


Funny it just wrote this for me:

  fn parse_image_url(html: &str) -> Option<String> {
      let re = regex::Regex::new(r#"src="([^"]+)""#).ok()?;
      re.captures(html)
          .and_then(|caps| caps.get(1))
          .map(|m| m.as_str().to_string())
  }
Prompt was "write a function which extracts image urls from a given block of html"




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: