Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc5ffe91

Browse files
committed
chore(cp): simplify return statement in handle_no_preserve_mode function
1 parent37ec58b commitc5ffe91

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

‎Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,6 @@ needless_pass_by_value = "allow" # 16
657657
float_cmp ="allow"# 12
658658
items_after_statements ="allow"# 11
659659
return_self_not_must_use ="allow"# 8
660-
redundant_else ="allow"# 6
661660
needless_continue ="allow"# 6
662661
inline_always ="allow"# 6
663662
fn_params_excessive_bools ="allow"# 6

‎src/uu/cp/src/cp.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2662,10 +2662,11 @@ fn handle_no_preserve_mode(options: &Options, org_mode: u32) -> u32 {
26622662
constMODE_RW_UGO:u32 =
26632663
(S_IRUSR |S_IWUSR |S_IRGRP |S_IWGRP |S_IROTH |S_IWOTH)asu32;
26642664
constS_IRWXUGO:u32 =(S_IRWXU |S_IRWXG |S_IRWXO)asu32;
2665-
if is_explicit_no_preserve_mode{
2666-
returnMODE_RW_UGO;
2667-
}
2668-
return org_mode&S_IRWXUGO;
2665+
returnif is_explicit_no_preserve_mode{
2666+
MODE_RW_UGO
2667+
}else{
2668+
org_mode&S_IRWXUGO
2669+
};
26692670
}
26702671
}
26712672

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp