1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! Natural-language list formatting.
//!
//! This module joins slices into readable lists while respecting locale-aware
//! conjunctions and serial-comma preferences.
pub use ListDisplay;
pub use ListOptions;
/// Creates a natural-language list formatter using the default locale.
///
/// # Examples
///
/// ```rust
/// let out = humfmt::list(&["red", "green", "blue"]);
/// assert_eq!(out.to_string(), "red, green, and blue");
/// ```
/// Creates a natural-language list formatter with custom options.
///
/// # Examples
///
/// ```rust
/// use humfmt::{list_with, ListOptions};
///
/// let out = list_with(
/// &["red", "green", "blue"],
/// ListOptions::new()
/// .serial_comma_enabled(false)
/// .conjunction("plus"),
/// );
/// assert_eq!(out.to_string(), "red, green plus blue");
/// ```