You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: util.rs
    path of file: ./repos/summarize/src
    
    the code of the file until where you have to start completion: use std::path::PathBuf;
use tempdir::TempDir;
use anyhow::Result;
use std::process::Stdio;

#[derive(Debug)]
pub struct Segment {
    pub index: u32,
    pub path: PathBuf,
    pub transcript: String
}

pub async fn split_file(path: PathBuf, tmp_dir: &TempDir) -> Result<Vec<Segment>, std::io::Error> {

    let mut command = tokio::process::Command::new("ffmpeg")
    .arg("-i")
    .arg(path)
    .arg("-f")
    .arg("segment")
    .arg("-segment_time")
    .arg("180")
    .arg("-c")
    .arg("copy")
    .arg(format!("{}/output%03d.mp3", tmp_dir.path().display()))
    .stdout(Stdio::null())
    .stderr(Stdio::null())
    .spawn()?;

    let _status = command.wait().await?;


    let mut filenames: Vec<PathBuf> = tmp_dir.path().read_dir()?.map(|entry| {
        entry.unwrap().path()
    }).collect();
    filenames.sor
    
pub async fn split_file(path: PathBuf, tmp_dir: &TempDir) -> Result<Vec<Segment>, std::io::Error> {

    let mut command = tokio::process::Command::new("ffmpeg")
    .arg("-i")
    .arg(path)
    .arg("-f")
    .arg("segment")
    .arg("-segment_time")
    .arg("180")
    .arg("-c")
    .arg("copy")
    .arg(format!("{}/output%03d.mp3", tmp_dir.path().display()))
    .stdout(Stdio::null())
    .stderr(Stdio::null())
    .spawn()?;

    let _status = command.wait().await?;


    let mut filenames: Vec<PathBuf> = tmp_dir.path().read_dir()?.map(|entry| {
        entry.unwrap().path()
    }).collect();
    filenames.sort();

    let segments: Vec<Segment> = filenames.iter().enumerate().map(|(i, path)| {
        Segment {
            index: i as u32,
            path: path.clone(),
            transcript: String::new()
        }
    }).collect();
    Ok(segments)
}