Add a comment about non-panicking of splitn().next().unwrap()

Co-authored-by: Joshua Nelson <joshua@yottadb.com>
This commit is contained in:
Ian Jackson 2020-10-28 21:25:47 +00:00 committed by GitHub
parent 39b80cb7c0
commit 1d6c860277
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -394,6 +394,7 @@ impl Options {
.iter()
.map(|s| {
let mut kv = s.splitn(2, '=');
// never panics because `splitn` always returns at least one element
let k = kv.next().unwrap().to_string();
let v = kv.next().unwrap_or("true").to_string();
(k, v)