mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 03:57:44 +00:00
mktemp: remove unnecessary convertion for path -> str just use prefix_from_template
This commit is contained in:
parent
be2b7032f6
commit
a87bc9f929
1 changed files with 1 additions and 5 deletions
|
@ -281,11 +281,7 @@ impl Params {
|
||||||
.join(prefix_from_template)
|
.join(prefix_from_template)
|
||||||
.display()
|
.display()
|
||||||
.to_string();
|
.to_string();
|
||||||
|
if options.treat_as_template && prefix_from_template.contains(MAIN_SEPARATOR) {
|
||||||
// Check that the prefix is valid.
|
|
||||||
let prefix_of_template = Path::new(prefix_from_template).to_string_lossy();
|
|
||||||
|
|
||||||
if options.treat_as_template && prefix_of_template.contains(MAIN_SEPARATOR) {
|
|
||||||
return Err(MkTempError::PrefixContainsDirSeparator(options.template));
|
return Err(MkTempError::PrefixContainsDirSeparator(options.template));
|
||||||
}
|
}
|
||||||
if tmpdir.is_some() && Path::new(prefix_from_template).is_absolute() {
|
if tmpdir.is_some() && Path::new(prefix_from_template).is_absolute() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue