/rust/registry/src/index.crates.io-6f17d22bba15001f/icu_casemap-1.5.1/src/set.rs
Line | Count | Source (jump to first uncovered line) |
1 | | // This file is part of ICU4X. For terms of use, please see the file |
2 | | // called LICENSE at the top level of the ICU4X source tree |
3 | | // (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ). |
4 | | |
5 | | use icu_collections::codepointinvlist::CodePointInversionListBuilder; |
6 | | |
7 | | /// An object that accepts characters and/or strings |
8 | | /// to be used with [`CaseMapCloser::add_string_case_closure_to()`] |
9 | | /// and [`CaseMapCloser::add_case_closure_to()`]. Usually this object |
10 | | /// will be some kind of set over codepoints and strings, or something that |
11 | | /// can be built into one. |
12 | | /// |
13 | | /// [`CaseMapCloser::add_string_case_closure_to()`]: crate::CaseMapCloser::add_string_case_closure_to |
14 | | /// [`CaseMapCloser::add_case_closure_to()`]: crate::CaseMapCloser::add_case_closure_to |
15 | | pub trait ClosureSink { |
16 | | /// Add a character to the set |
17 | | fn add_char(&mut self, c: char); |
18 | | /// Add a string to the set |
19 | | fn add_string(&mut self, string: &str); |
20 | | } |
21 | | |
22 | | impl ClosureSink for CodePointInversionListBuilder { |
23 | 0 | fn add_char(&mut self, c: char) { |
24 | 0 | self.add_char(c) |
25 | 0 | } |
26 | | |
27 | | // The current version of CodePointInversionList doesn't include strings. |
28 | | // Trying to add a string is a no-op that will be optimized away. |
29 | | #[inline] |
30 | 0 | fn add_string(&mut self, _string: &str) {} Unexecuted instantiation: <icu_collections::codepointinvlist::builder::CodePointInversionListBuilder as icu_casemap::set::ClosureSink>::add_string Unexecuted instantiation: <icu_collections::codepointinvlist::builder::CodePointInversionListBuilder as icu_casemap::set::ClosureSink>::add_string |
31 | | } |