Debian Codegraph @

src/common.rs

raw symbols SCIP
1 #[inline]
2 pub(crate) fn is_indent(c: char) -> bool {
3 // deb822(5) says that continuation lines
4 // start with a space (U+0020) or a tab (U+0009).
5 c == ' ' || c == '\t'
6 }
7
8 #[inline]
9 pub(crate) fn is_newline(c: char) -> bool {
10 c == '\n' || c == '\r'
11 }
12
13 #[inline]
14 pub(crate) fn is_valid_key_char(c: char) -> bool {
15 // deb822(5) says valid field characters are US-ASCII
16 // characters excluding control characters, space and colon
17 // (i.e. characters in the ranges U+0021 to U+0039 and U+003B to U+007E).
18 // I.e. printable characters except for space and colon.
19 c.is_ascii_graphic() && c != ':' && c != ' '
20 }
21
22 #[inline]
23 pub(crate) fn is_valid_initial_key_char(c: char) -> bool {
24 c != '-' && is_valid_key_char(c)
25 }