mirror of
https://github.com/Hopiu/lychee.git
synced 2026-03-29 10:50:24 +00:00
Makes for arguably cleaner-looking code. The downside is that the MSRV is 1.58 https://blog.rust-lang.org/2022/01/13/Rust-1.58.0.html Given that nobody uses lychee as a library yet and we have precompiled binaries, it's an acceptable tradeoff. My little research revealed that this is a much-liked feature: https://twitter.com/matthiasendler/status/1483895557621960715
13 lines
361 B
Rust
13 lines
361 B
Rust
use lychee_lib::extract::Extractor;
|
|
use lychee_lib::Result;
|
|
use lychee_lib::{FileType, InputContent};
|
|
use std::fs;
|
|
|
|
#[tokio::main]
|
|
async fn main() -> Result<()> {
|
|
let input = fs::read_to_string("fixtures/elvis.html").unwrap();
|
|
let links = Extractor::extract(&InputContent::from_string(&input, FileType::Html));
|
|
println!("{links:#?}");
|
|
|
|
Ok(())
|
|
}
|