Skip to content

Commit 440e634

Browse files
committed
fmt :/
1 parent bd08cdd commit 440e634

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

chacha20/src/rng.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -344,9 +344,9 @@ macro_rules! impl_chacha_rng {
344344
word_pos & ((1 << 68) - 1)
345345
}
346346

347-
/// Set the offset from the start of the stream, in 32-bit words. **This
348-
/// value will be erased when calling `set_stream()`, so call
349-
/// `set_stream()` before calling `set_word_pos()`** if you intend on
347+
/// Set the offset from the start of the stream, in 32-bit words. **This
348+
/// value will be erased when calling `set_stream()`, so call
349+
/// `set_stream()` before calling `set_word_pos()`** if you intend on
350350
/// using both of them together.
351351
///
352352
/// As with `get_word_pos`, we use a 68-bit number. Since the generator
@@ -362,9 +362,9 @@ macro_rules! impl_chacha_rng {
362362
self.core.reset_and_skip(index);
363363
}
364364

365-
/// Sets the block pos and resets the RNG's index. **This value will be
366-
/// erased when calling `set_stream()`, so call `set_stream()` before
367-
/// calling `set_block_pos()`** if you intend on using both of them
365+
/// Sets the block pos and resets the RNG's index. **This value will be
366+
/// erased when calling `set_stream()`, so call `set_stream()` before
367+
/// calling `set_block_pos()`** if you intend on using both of them
368368
/// together.
369369
///
370370
/// The word pos will be equal to `block_pos * 16 words per block`.
@@ -388,7 +388,8 @@ macro_rules! impl_chacha_rng {
388388
#[inline]
389389
#[allow(unused)]
390390
pub fn get_block_pos(&self) -> u64 {
391-
let counter = self.core.core.0.state[12] as u64 | ((self.core.core.0.state[13] as u64) << 32);
391+
let counter =
392+
self.core.core.0.state[12] as u64 | ((self.core.core.0.state[13] as u64) << 32);
392393
if self.core.word_offset() != 0 {
393394
counter - 4 + self.core.word_offset() as u64 / 16
394395
} else {
@@ -397,7 +398,7 @@ macro_rules! impl_chacha_rng {
397398
}
398399

399400
/// Sets the stream number, resetting the `index` and `block_pos` to 0,
400-
/// effectively setting the `word_pos` to 0 as well. Consider storing
401+
/// effectively setting the `word_pos` to 0 as well. Consider storing
401402
/// the `word_pos` prior to calling this method.
402403
///
403404
/// This method takes any of the following:
@@ -427,7 +428,7 @@ macro_rules! impl_chacha_rng {
427428
/// // confirm that state is set correctly
428429
/// assert_eq!(rng.get_block_pos(), 1 << 32);
429430
/// assert_eq!(rng.get_stream(), (3 << 32) + 2);
430-
///
431+
///
431432
/// // restoring `word_pos`/`index` after calling `set_stream`:
432433
/// let word_pos = rng.get_word_pos();
433434
/// rng.set_stream(4);
@@ -1080,7 +1081,6 @@ pub(crate) mod tests {
10801081
rng.set_word_pos(word_pos);
10811082
assert_eq!(rng.next_u32(), test);
10821083

1083-
10841084
word_pos = rng.get_word_pos();
10851085
assert_eq!(word_pos, 2);
10861086
rng.set_stream([1, 2, 3, 4, 5, 6, 7, 8]);

0 commit comments

Comments
 (0)