<commit_before>use consumer::*;
use producer::*;
use std::rc::Rc;
use stream::*;

/// Constructs a new empty `Stream` based on a `Empty`.
///
/// # Examples
///
/// ```
/// use asyncplify::*;
///
/// Empty
///     .subscribe();
/// ```
pub struct Empty;

impl Stream<()> for Empty {
    fn consume<C: Consumer<()>>(self, mut consumer: C) {
        consumer.init(Rc::new(Producer::new()));
    }
}

#[cfg(test)]
mod tests {
    use super::*;
    use subscription::*;
    use tap::*;

    #[test]
    fn it_works() {
        let mut count = 0;

        Empty.tap(|_| count += 1)
             .subscribe();

        assert!(count == 0, "count = {}", count);
    }
}
<commit_msg>add an example for Empty<commit_after>use consumer::*;
use producer::*;
use std::rc::Rc;
use stream::*;

/// Constructs a new empty `Stream` based on a `Empty`.
///
/// # Examples
///
/// ```
/// use asyncplify::*;
///
/// let mut count = 0;
///
/// Empty
///     .tap(|_| count += 1)
///     .subscribe();
///
/// assert!(count == 0, "count = {}", count);
/// ```
pub struct Empty;

impl Stream<()> for Empty {
    fn consume<C: Consumer<()>>(self, mut consumer: C) {
        consumer.init(Rc::new(Producer::new()));
    }
}
{'fraction_non_alphanumeric': 0.24416666666666667, 'fraction_numerical': 0.005, 'mean_word_length': 2.326869806094183, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5644238', 'n_tokens_mistral': 425, 'n_tokens_neox': 409, 'n_words': 111}