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