// like read_until_words, but splits by rarest character, which is b'Q'
// also uses slightly bigger initial buffers
like read_until_words, but splits by rarest character, which is b'Q'
also uses slightly bigger initial buffers
like read_until_words but splits by rarest character which is b ' Q ' also uses slightly bigger initial buffers
fn read_until_words_long<B: Buffer>()
	where
		B::Error: Debug,
		Error: From<B::Error>,
	{
		let mut r = BufRefReaderBuilder::new(WORDS)
			.capacity(32)
			.build::<B>()
			.unwrap();
		let mut words = WORDS.split(|&c| c == b'Q').peekable();
		while let Ok(Some(slice_buf)) = r.read_until(b'Q') {
			let mut slice_words = words.next().unwrap()
				.to_vec();
			if words.peek() != None {
				slice_words.push(b'Q');
			}
			assert_eq!(slice_buf, &slice_words[..]);
		}
		assert_eq!(words.next(), None);
	}
fn read_until_words_long < B : Buffer > ( ) where B :: Error : Debug , Error : From < B :: Error > , { let mut r = BufRefReaderBuilder :: new ( WORDS ) . capacity ( 32 ) . build :: < B > ( ) . unwrap ( ) ; let mut words = WORDS . split ( | & c | c == b'Q' ) . peekable ( ) ; while let Ok ( Some ( slice_buf ) ) = r . read_until ( b'Q' ) { let mut slice_words = words . next ( ) . unwrap ( ) . to_vec ( ) ; if words . peek ( ) != None { slice_words . push ( b'Q' ) ; } assert_eq ! ( slice_buf slice_words [ ] ) ; } assert_eq ! ( words next ( ) None ) ; }
like read_until_words, but splits by rarest character, which is b'Q'
also uses slightly bigger initial buffers
like read_until_words but splits by rarest character which is b ' Q ' also uses slightly bigger initial buffers