bitwise::word
pub fn copy_bit<T: Word, U: UnsignedWord>(x: T, from_bit: U, y: T, to_bit: U) -> T
Copys the from_bit of x into y at to_bit.
from_bit
x
y
to_bit
If bit >= bit_size() or pos >= bit_size().
bit >= bit_size() or pos >= bit_size()
use bitwise::word::*; let a = 0b1011_0010u8; let b = 0b1001_0010u8; let c = 0b1111_0010u8; assert_eq!(a.copy_bit(5u8, b, 5u8), a); assert_eq!(copy_bit(a, 6u8, c, 6u8), a);