refactor: make get_abs_path non-generic

Generic functions compile into multiple implementations,
increasing number of lines for LLVM to process,
code size and compilation times.
This commit is contained in:
link2xt
2023-09-02 18:17:04 +00:00
parent 9d7bdf369d
commit 49f143e0d5
4 changed files with 21 additions and 21 deletions

View File

@@ -5,7 +5,7 @@ use std::collections::BinaryHeap;
use std::convert::{TryFrom, TryInto};
use std::fmt;
use std::ops::Deref;
use std::path::PathBuf;
use std::path::{Path, PathBuf};
use std::time::{SystemTime, UNIX_EPOCH};
use anyhow::{bail, ensure, Context as _, Result};
@@ -1186,7 +1186,7 @@ impl Contact {
}
} else if let Some(image_rel) = self.param.get(Param::ProfileImage) {
if !image_rel.is_empty() {
return Ok(Some(get_abs_path(context, image_rel)));
return Ok(Some(get_abs_path(context, Path::new(image_rel))));
}
}
Ok(None)