File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -131,8 +131,10 @@ impl Options {
131131 ( tmpdir, OsString :: from ( template) )
132132 }
133133 Some ( template) => {
134- let tmpdir = if env:: var ( TMPDIR_ENV_VAR ) . is_ok ( ) && matches. get_flag ( OPT_T ) {
135- env:: var_os ( TMPDIR_ENV_VAR ) . map ( Into :: into)
134+ let tmpdir = if let Some ( tmpdir) = env:: var_os ( TMPDIR_ENV_VAR )
135+ && matches. get_flag ( OPT_T )
136+ {
137+ Some ( PathBuf :: from ( tmpdir) )
136138 } else if tmpdir. is_some ( ) {
137139 tmpdir
138140 } else if matches. get_flag ( OPT_T ) || matches. contains_id ( OPT_TMPDIR ) {
@@ -390,7 +392,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
390392 // application logic.
391393 let options = Options :: from ( & matches) ;
392394
393- if env:: var ( "POSIXLY_CORRECT" ) . is_ok ( ) {
395+ if env:: var_os ( "POSIXLY_CORRECT" ) . is_some ( ) {
394396 // If POSIXLY_CORRECT was set, template MUST be the last argument.
395397 if matches. contains_id ( ARG_TEMPLATE ) {
396398 // Template argument was provided, check if was the last one.
You can’t perform that action at this time.
0 commit comments