podal/src/history/add.rs

18 lines
375 B
Rust
Raw Normal View History

2023-07-25 10:55:02 +01:00
use crate::prelude::*;
use atom_syndication::Link;
use std::fs::OpenOptions;
use std::io::prelude::*;
pub fn mark_as_downloaded(link: &Link, file_name: &str) -> Result<()> {
let mut file = OpenOptions::new()
.write(true)
.append(true)
.create(true)
.open(file_name)
.unwrap();
writeln!(file, "{}", link.href)?;
Ok(())
}