diff options
Diffstat (limited to 'stream/types/src/path.rs')
| -rw-r--r-- | stream/types/src/path.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/stream/types/src/path.rs b/stream/types/src/path.rs index 4a91457..226d6e8 100644 --- a/stream/types/src/path.rs +++ b/stream/types/src/path.rs @@ -9,9 +9,9 @@ use crate::{FormatNum, IndexNum, StreamContainer, StreamSpec, TrackKind, TrackNu impl StreamSpec { pub fn to_path(&self) -> String { match self { - StreamSpec::HlsMultiVariant => format!("stream.m3u8"), - StreamSpec::Dash => format!("stream.mpd"), - StreamSpec::Info => format!("formats.json"), + StreamSpec::HlsMultiVariant => "stream.m3u8".to_string(), + StreamSpec::Dash => "stream.mpd".to_string(), + StreamSpec::Info => "formats.json".to_string(), StreamSpec::HlsVariant { track, format } => format!("{track}/{format}/variant.m3u8"), StreamSpec::FragmentIndex { track } => format!("{track}/fragindex.json"), StreamSpec::FragmentInit { @@ -35,7 +35,7 @@ impl StreamSpec { } } pub fn from_path(segments: &[&str]) -> Result<Self, &'static str> { - let mut segs = segments.into_iter(); + let mut segs = segments.iter(); match *segs.next().ok_or("no path")? { "stream.mpd" => Ok(Self::Dash), "stream.m3u8" => Ok(Self::HlsMultiVariant), |