lychee/examples/archive/archive.rs
Thomas Zahner 8f2f746bf9
Migrate to Clippy 1.88 (#1749)
* Update flake
* Fix clippy's new suggestions
* Do not ignore tests any longer since they work by now
* Add ignore reason
2025-06-27 12:34:48 +02:00

18 lines
483 B
Rust

use lychee_lib::archive::Archive;
use std::{error::Error, time::Duration};
use url::Url;
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
let archive = Archive::WaybackMachine;
let url = Url::parse("https://example.com")?;
let result = archive
.get_archive_snapshot(&url, Duration::from_secs(10))
.await?;
if let Some(replacement) = result {
println!("Good news! {url} can be replaced with {replacement}");
}
Ok(())
}