~jshholland/spektilo

f2370e584b7931f02eca50add800ee4e9a9023c6 — Josh Holland 2 years ago 534ccf9 master
Tidy up unnecessary borrows etc
1 files changed, 5 insertions(+), 5 deletions(-)

M src/main.rs
M src/main.rs => src/main.rs +5 -5
@@ 70,7 70,7 @@ impl State {
            return Ok(());
        }

        tokio::fs::create_dir(&name).await.or_else(|e| {
        fs::create_dir(name).await.or_else(|e| {
            if e.kind() == ErrorKind::AlreadyExists {
                Ok(())
            } else {


@@ 81,7 81,7 @@ impl State {
        let child = Command::new("youtube-dl")
            .arg("--")
            .args(ids)
            .current_dir(&name)
            .current_dir(name)
            .spawn()?;

        let status = child.await?;


@@ 121,7 121,7 @@ async fn main() -> Result<()> {
            })
        })
        .ok_or("couldn't get config directory")?;
    let conf: Config = toml::from_str(&tokio::fs::read_to_string(&conf_path).await?)?;
    let conf: Config = toml::from_str(&fs::read_to_string(&conf_path).await?)?;

    if !conf.base_dir.is_absolute() {
        return Err(format!(


@@ 138,7 138,7 @@ async fn main() -> Result<()> {

    let fname = ".spektilo.state";

    let seen = match File::open(&fname).await {
    let seen = match File::open(fname).await {
        // we have to do explicit pattern matching here because .map
        // won't let us use an async function
        Ok(mut f) => {


@@ 158,7 158,7 @@ async fn main() -> Result<()> {
        state
            .get_items(
                &name,
                &vid_ids.iter().map(|s| s.as_str()).collect::<Vec<_>>(),
                &vid_ids.iter().map(String::as_str).collect::<Vec<_>>(),
            )
            .await?;
    }