Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Debug on all public structs #131

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/grapheme.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use crate::tables::grapheme::GraphemeCat;
///
/// [`grapheme_indices`]: trait.UnicodeSegmentation.html#tymethod.grapheme_indices
/// [`UnicodeSegmentation`]: trait.UnicodeSegmentation.html
#[derive(Clone)]
#[derive(Debug, Clone)]
pub struct GraphemeIndices<'a> {
start_offset: usize,
iter: Graphemes<'a>,
Expand Down
12 changes: 6 additions & 6 deletions src/sentence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ mod fwd {

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

#[derive(Clone, PartialEq, Eq)]
#[derive(Debug, Clone, PartialEq, Eq)]
struct SentenceBreaksState(pub [StatePart; 4]);

const INITIAL_STATE: SentenceBreaksState = SentenceBreaksState([
Expand All @@ -43,7 +43,7 @@ mod fwd {
StatePart::Sot,
]);

#[derive(Clone)]
#[derive(Debug, Clone)]
pub struct SentenceBreaks<'a> {
pub string: &'a str,
pos: usize,
Expand Down Expand Up @@ -296,7 +296,7 @@ mod fwd {
///
/// [`unicode_sentences`]: trait.UnicodeSegmentation.html#tymethod.unicode_sentences
/// [`UnicodeSegmentation`]: trait.UnicodeSegmentation.html
#[derive(Clone)]
#[derive(Debug, Clone)]
pub struct UnicodeSentences<'a> {
inner: Filter<USentenceBounds<'a>, fn(&&str) -> bool>,
}
Expand All @@ -309,7 +309,7 @@ pub struct UnicodeSentences<'a> {
///
/// [`split_sentence_bounds`]: trait.UnicodeSegmentation.html#tymethod.split_sentence_bounds
/// [`UnicodeSegmentation`]: trait.UnicodeSegmentation.html
#[derive(Clone)]
#[derive(Debug, Clone)]
pub struct USentenceBounds<'a> {
iter: fwd::SentenceBreaks<'a>,
sentence_start: Option<usize>,
Expand All @@ -322,7 +322,7 @@ pub struct USentenceBounds<'a> {
///
/// [`split_sentence_bound_indices`]: trait.UnicodeSegmentation.html#tymethod.split_sentence_bound_indices
/// [`UnicodeSegmentation`]: trait.UnicodeSegmentation.html
#[derive(Clone)]
#[derive(Debug, Clone)]
pub struct USentenceBoundIndices<'a> {
start_offset: usize,
iter: USentenceBounds<'a>,
Expand Down
6 changes: 4 additions & 2 deletions src/word.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ use crate::tables::word::WordCat;
///
/// [`unicode_words`]: trait.UnicodeSegmentation.html#tymethod.unicode_words
/// [`UnicodeSegmentation`]: trait.UnicodeSegmentation.html
#[derive(Debug)]
pub struct UnicodeWords<'a> {
inner: Filter<UWordBounds<'a>, fn(&&str) -> bool>,
}
Expand Down Expand Up @@ -62,6 +63,7 @@ impl<'a> DoubleEndedIterator for UnicodeWords<'a> {
///
/// [`unicode_word_indices`]: trait.UnicodeSegmentation.html#tymethod.unicode_word_indices
/// [`UnicodeSegmentation`]: trait.UnicodeSegmentation.html
#[derive(Debug)]
pub struct UnicodeWordIndices<'a> {
inner: Filter<UWordBoundIndices<'a>, fn(&(usize, &str)) -> bool>,
}
Expand Down Expand Up @@ -94,7 +96,7 @@ impl<'a> DoubleEndedIterator for UnicodeWordIndices<'a> {
///
/// [`split_word_bounds`]: trait.UnicodeSegmentation.html#tymethod.split_word_bounds
/// [`UnicodeSegmentation`]: trait.UnicodeSegmentation.html
#[derive(Clone)]
#[derive(Debug, Clone)]
pub struct UWordBounds<'a> {
string: &'a str,
cat: Option<WordCat>,
Expand All @@ -108,7 +110,7 @@ pub struct UWordBounds<'a> {
///
/// [`split_word_bound_indices`]: trait.UnicodeSegmentation.html#tymethod.split_word_bound_indices
/// [`UnicodeSegmentation`]: trait.UnicodeSegmentation.html
#[derive(Clone)]
#[derive(Debug, Clone)]
pub struct UWordBoundIndices<'a> {
start_offset: usize,
iter: UWordBounds<'a>,
Expand Down