This commit is contained in:
Alex 2022-11-17 16:56:55 +01:00
parent 4d4f9336d6
commit dc5bcec658
Signed by: lx
GPG Key ID: 0E496D15096376BE
1 changed files with 2 additions and 3 deletions

View File

@ -251,7 +251,6 @@ impl<'a, 'b> Term<'a, 'b> {
}
/// Checks term is a dictionnary and returns hashmap of inner terms.
/// For convenience, this transforms the keys of the dictionnary into `&str`'s.
///
/// Example:
///
@ -289,7 +288,7 @@ impl<'a, 'b> Term<'a, 'b> {
/// assert_eq!(s1.str().unwrap(), "v1");
/// assert_eq!(s2.str().unwrap(), "v2");
///
/// assert!(term.dict_of([b"k1", b"k2"], false).is_err());
/// assert!(term.dict_of(["k1", "k2"], false).is_err());
/// ```
pub fn dict_of<const N: usize, T: AsRef<[u8]>>(
&self,
@ -327,7 +326,7 @@ impl<'a, 'b> Term<'a, 'b> {
/// use nettext::dec::decode;
///
/// let term = decode(b"{ k1 = v1, k2 = v2, k4 = v4 }").unwrap();
/// let [s1, s2, s3] = term.dict_of_opt([b"k1", b"k2", b"k3"], true).unwrap();
/// let [s1, s2, s3] = term.dict_of_opt(["k1", "k2", "k3"], true).unwrap();
/// assert_eq!(s1.unwrap().str().unwrap(), "v1");
/// assert_eq!(s2.unwrap().str().unwrap(), "v2");
/// assert!(s3.is_none());