Better function name
This commit is contained in:
		| @@ -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); | ||||
|     } | ||||
|   | ||||
| @@ -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<Error>> { | ||||
| pub fn extract_first_image(music_filename: &Path, image_filename: &Path) -> Result<(), Box<Error>> { | ||||
|     let tag = id3::Tag::read_from_path(&music_filename). | ||||
|         map_err(|e| format!("Error reading music file {:?}: {}", music_filename, e))?; | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Andrew Radev
					Andrew Radev