mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
do not use str.split_once, as it is not in MSRV
This commit is contained in:
parent
e94c29ae2f
commit
bc8bb52551
1 changed files with 6 additions and 3 deletions
|
@ -61,10 +61,13 @@ enum Prop {
|
|||
|
||||
#[allow(clippy::ptr_arg)]
|
||||
fn uda_string_to_tuple(key: &str) -> (&str, &str) {
|
||||
if let Some((ns, key)) = key.split_once('.') {
|
||||
(ns, key)
|
||||
let mut iter = key.splitn(2, '.');
|
||||
let first = iter.next().unwrap();
|
||||
let second = iter.next();
|
||||
if let Some(second) = second {
|
||||
(first, second)
|
||||
} else {
|
||||
("", key)
|
||||
("", first)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue