to_description

Function to_description 

Source
pub fn to_description(chapters: &[Chapter]) -> Result<String, String>
Expand description

Writes chapters to episode description (show notes).

Only the start time and title are used.

ยงExample:

let chapters = vec![
    Chapter {
        start: Duration::zero(),
        title: Some("The Movement".to_string()),
        link: Some(Link {
            url: url::Url::parse("https://example.com/the-movement").unwrap(),
            title: None,
        }),
        ..Default::default()
    },
    Chapter {
        start: Duration::minutes(5) + Duration::seconds(4),
        title: Some("Baboons".to_string()),
        ..Default::default()
    },
    Chapter {
        start: Duration::minutes(9) + Duration::seconds(58),
        title: Some("Steve Jobs".to_string()),
        ..Default::default()
    },
];

let description = chapters::to_description(&chapters).expect("Failed to write chapters");
assert_eq!(
    description,
    r#"00:00 The Movement
05:04 Baboons
09:58 Steve Jobs
"#
);