Cleanup warnings
This commit is contained in:
@@ -16,7 +16,7 @@ pub async fn generate_video_gifs() {
|
||||
|
||||
let start = std::time::Instant::now();
|
||||
let tracer = global_tracer();
|
||||
let span = tracer.start("creating video gifs");
|
||||
tracer.start("creating video gifs");
|
||||
|
||||
let gif_base_path = &dotenv::var("GIFS_DIRECTORY").unwrap_or(String::from("gifs"));
|
||||
let gif_directory: &Path = Path::new(gif_base_path);
|
||||
@@ -29,7 +29,7 @@ pub async fn generate_video_gifs() {
|
||||
.into_iter()
|
||||
.filter_map(|entry| entry.ok())
|
||||
.filter(|entry| entry.file_type().is_file())
|
||||
.filter(|entry| is_video(entry))
|
||||
.filter(is_video)
|
||||
.filter(|entry| {
|
||||
let path = entry.path();
|
||||
let relative_path = &path.strip_prefix(&files).unwrap();
|
||||
@@ -43,10 +43,8 @@ pub async fn generate_video_gifs() {
|
||||
let gif_path = Path::new(gif_directory).join(relative_path);
|
||||
let gif_path = gif_path.with_extension("gif");
|
||||
if let Some(parent_dir) = gif_path.parent() {
|
||||
fs::create_dir_all(parent_dir).expect(&format!(
|
||||
"There was an issue creating gif directory {:?}",
|
||||
gif_path
|
||||
));
|
||||
fs::create_dir_all(parent_dir).unwrap_or_else(|_| panic!("There was an issue creating gif directory {:?}",
|
||||
gif_path));
|
||||
}
|
||||
info!("Generating gif for {:?}", path);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user