1extern crate subparse;
2
3use subparse::timetypes::{TimePoint, TimeSpan};
4use subparse::{SrtFile, SubtitleFileInterface};
5
6fn main() {
7 let lines = vec![
9 (
10 TimeSpan::new(TimePoint::from_msecs(1500), TimePoint::from_msecs(3700)),
11 "line1".to_string(),
12 ),
13 (
14 TimeSpan::new(TimePoint::from_msecs(4500), TimePoint::from_msecs(8700)),
15 "line2".to_string(),
16 ),
17 ];
18 let file = SrtFile::create(lines).unwrap();
19
20 let srt_string = String::from_utf8(file.to_data().unwrap()).unwrap();
22 println!("{}", srt_string);
23}