Skip to content

Commit 96dfef5

Browse files
authored
Merge pull request #131 from syvb/debug-pub-interfaces
Implement Debug on all public structs
2 parents 8b894ca + 1f88570 commit 96dfef5

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

src/grapheme.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use crate::tables::grapheme::GraphemeCat;
1919
///
2020
/// [`grapheme_indices`]: trait.UnicodeSegmentation.html#tymethod.grapheme_indices
2121
/// [`UnicodeSegmentation`]: trait.UnicodeSegmentation.html
22-
#[derive(Clone)]
22+
#[derive(Debug, Clone)]
2323
pub struct GraphemeIndices<'a> {
2424
start_offset: usize,
2525
iter: Graphemes<'a>,

src/sentence.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ mod fwd {
1818

1919
// Describe a parsed part of source string as described in this table:
2020
// https://unicode.org/reports/tr29/#Default_Sentence_Boundaries
21-
#[derive(Clone, Copy, PartialEq, Eq)]
21+
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
2222
enum StatePart {
2323
Sot,
2424
Eot,
@@ -33,7 +33,7 @@ mod fwd {
3333
STerm,
3434
}
3535

36-
#[derive(Clone, PartialEq, Eq)]
36+
#[derive(Debug, Clone, PartialEq, Eq)]
3737
struct SentenceBreaksState(pub [StatePart; 4]);
3838

3939
const INITIAL_STATE: SentenceBreaksState = SentenceBreaksState([
@@ -43,7 +43,7 @@ mod fwd {
4343
StatePart::Sot,
4444
]);
4545

46-
#[derive(Clone)]
46+
#[derive(Debug, Clone)]
4747
pub struct SentenceBreaks<'a> {
4848
pub string: &'a str,
4949
pos: usize,
@@ -296,7 +296,7 @@ mod fwd {
296296
///
297297
/// [`unicode_sentences`]: trait.UnicodeSegmentation.html#tymethod.unicode_sentences
298298
/// [`UnicodeSegmentation`]: trait.UnicodeSegmentation.html
299-
#[derive(Clone)]
299+
#[derive(Debug, Clone)]
300300
pub struct UnicodeSentences<'a> {
301301
inner: Filter<USentenceBounds<'a>, fn(&&str) -> bool>,
302302
}
@@ -309,7 +309,7 @@ pub struct UnicodeSentences<'a> {
309309
///
310310
/// [`split_sentence_bounds`]: trait.UnicodeSegmentation.html#tymethod.split_sentence_bounds
311311
/// [`UnicodeSegmentation`]: trait.UnicodeSegmentation.html
312-
#[derive(Clone)]
312+
#[derive(Debug, Clone)]
313313
pub struct USentenceBounds<'a> {
314314
iter: fwd::SentenceBreaks<'a>,
315315
sentence_start: Option<usize>,
@@ -322,7 +322,7 @@ pub struct USentenceBounds<'a> {
322322
///
323323
/// [`split_sentence_bound_indices`]: trait.UnicodeSegmentation.html#tymethod.split_sentence_bound_indices
324324
/// [`UnicodeSegmentation`]: trait.UnicodeSegmentation.html
325-
#[derive(Clone)]
325+
#[derive(Debug, Clone)]
326326
pub struct USentenceBoundIndices<'a> {
327327
start_offset: usize,
328328
iter: USentenceBounds<'a>,

src/word.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ use crate::tables::word::WordCat;
2525
///
2626
/// [`unicode_words`]: trait.UnicodeSegmentation.html#tymethod.unicode_words
2727
/// [`UnicodeSegmentation`]: trait.UnicodeSegmentation.html
28+
#[derive(Debug)]
2829
pub struct UnicodeWords<'a> {
2930
inner: Filter<UWordBounds<'a>, fn(&&str) -> bool>,
3031
}
@@ -62,6 +63,7 @@ impl<'a> DoubleEndedIterator for UnicodeWords<'a> {
6263
///
6364
/// [`unicode_word_indices`]: trait.UnicodeSegmentation.html#tymethod.unicode_word_indices
6465
/// [`UnicodeSegmentation`]: trait.UnicodeSegmentation.html
66+
#[derive(Debug)]
6567
pub struct UnicodeWordIndices<'a> {
6668
inner: Filter<UWordBoundIndices<'a>, fn(&(usize, &str)) -> bool>,
6769
}
@@ -94,7 +96,7 @@ impl<'a> DoubleEndedIterator for UnicodeWordIndices<'a> {
9496
///
9597
/// [`split_word_bounds`]: trait.UnicodeSegmentation.html#tymethod.split_word_bounds
9698
/// [`UnicodeSegmentation`]: trait.UnicodeSegmentation.html
97-
#[derive(Clone)]
99+
#[derive(Debug, Clone)]
98100
pub struct UWordBounds<'a> {
99101
string: &'a str,
100102
cat: Option<WordCat>,
@@ -108,7 +110,7 @@ pub struct UWordBounds<'a> {
108110
///
109111
/// [`split_word_bound_indices`]: trait.UnicodeSegmentation.html#tymethod.split_word_bound_indices
110112
/// [`UnicodeSegmentation`]: trait.UnicodeSegmentation.html
111-
#[derive(Clone)]
113+
#[derive(Debug, Clone)]
112114
pub struct UWordBoundIndices<'a> {
113115
start_offset: usize,
114116
iter: UWordBounds<'a>,

0 commit comments

Comments
 (0)