Skip to content

Commit 1d6c860

Browse files
ijacksonJoshua Nelson
and
Joshua Nelson
authored
Add a comment about non-panicking of splitn().next().unwrap()
Co-authored-by: Joshua Nelson <[email protected]>
1 parent 39b80cb commit 1d6c860

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/librustdoc/config.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,7 @@ impl Options {
394394
.iter()
395395
.map(|s| {
396396
let mut kv = s.splitn(2, '=');
397+
// never panics because `splitn` always returns at least one element
397398
let k = kv.next().unwrap().to_string();
398399
let v = kv.next().unwrap_or("true").to_string();
399400
(k, v)

0 commit comments

Comments
 (0)