File tree 1 file changed +10
-0
lines changed
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -1089,6 +1089,16 @@ pub mod tests {
1089
1089
}
1090
1090
1091
1091
fn cmdline_contains ( cmdline : & Cmdline , slug : & str ) -> bool {
1092
+ // The following unwraps can never fail; the only way any of these methods
1093
+ // would return an `Err` is if one of the following conditions is met:
1094
+ // 1. The command line is empty: We just added things to it, and if insertion
1095
+ // of an argument goes wrong, then `Cmdline::insert` would have already
1096
+ // returned `Err`.
1097
+ // 2. There's a spurious null character somewhere in the command line: The
1098
+ // `Cmdline::insert` methods verify that this is not the case.
1099
+ // 3. The `CString` is not valid UTF8: It just got created from a `String`,
1100
+ // which was valid UTF8.
1101
+
1092
1102
cmdline
1093
1103
. as_cstring ( )
1094
1104
. unwrap ( )
You can’t perform that action at this time.
0 commit comments