From 67d39f4172bfa16da358cfba3baa67e75b020803 Mon Sep 17 00:00:00 2001 From: Andrew Radev Date: Sun, 24 Feb 2019 16:20:14 +0200 Subject: [PATCH] Better function name --- src/bin/id3-image-extract.rs | 4 ++-- src/lib.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bin/id3-image-extract.rs b/src/bin/id3-image-extract.rs index 6169f0d..f9b9266 100644 --- a/src/bin/id3-image-extract.rs +++ b/src/bin/id3-image-extract.rs @@ -2,7 +2,7 @@ use std::process; use std::path::PathBuf; use structopt::StructOpt; -use id3_image::extract_image; +use id3_image::extract_first_image; #[derive(StructOpt, Debug)] #[structopt(name = "id3-image-embed")] @@ -26,7 +26,7 @@ fn main() { let image_filename = opt.image_filename.clone(). unwrap_or_else(|| opt.music_filename.with_extension("jpg")); - if let Err(e) = extract_image(&opt.music_filename, &image_filename) { + if let Err(e) = extract_first_image(&opt.music_filename, &image_filename) { eprintln!("{}", e); process::exit(1); } diff --git a/src/lib.rs b/src/lib.rs index 3e37f4b..0024f99 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -25,7 +25,7 @@ pub fn embed_image(music_filename: &Path, image_filename: &Path) -> Result<(), B Ok(()) } -pub fn extract_image(music_filename: &Path, image_filename: &Path) -> Result<(), Box> { +pub fn extract_first_image(music_filename: &Path, image_filename: &Path) -> Result<(), Box> { let tag = id3::Tag::read_from_path(&music_filename). map_err(|e| format!("Error reading music file {:?}: {}", music_filename, e))?;