From acda8866cc206e0ab259d800642bacacdbe113a8 Mon Sep 17 00:00:00 2001 From: Imbolc Date: Mon, 13 Jun 2022 13:35:49 +0300 Subject: [PATCH] Document an edge case of `str::split_once` --- library/core/src/str/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/library/core/src/str/mod.rs b/library/core/src/str/mod.rs index 5223c43acc2..c4f2e283eb3 100644 --- a/library/core/src/str/mod.rs +++ b/library/core/src/str/mod.rs @@ -1632,6 +1632,7 @@ pub fn rsplitn<'a, P>(&'a self, n: usize, pat: P) -> RSplitN<'a, P> /// /// ``` /// assert_eq!("cfg".split_once('='), None); + /// assert_eq!("cfg=".split_once('='), Some(("cfg", ""))); /// assert_eq!("cfg=foo".split_once('='), Some(("cfg", "foo"))); /// assert_eq!("cfg=foo=bar".split_once('='), Some(("cfg", "foo=bar"))); /// ```