This could be 
```rust
( $($ty: ty => $method: ident;)* ) => {
    $(
        impl<'a, S: StreamState> Hash<S> for $ty {
            #[inline]
            fn hash(&self, mut state: S) -> u64 {
                self.input(&mut state);
                state.result()
            }
        }

        impl<'a, S: StreamState> StreamHash<S> for $ty {
            #[inline]
            fn input(&self, state: &mut S) {
                state.$method(*self)
            }
        }
    )*
}

impl_hash!(u8 => input_u8; u16 => input_u16; ...)
```