Rollup merge of #58569 - kenta7777:reduce-code-repetition, r=oli-obk
Rollup merge of #58569 - kenta7777:reduce-code-repetition, r=oli-obk

Reduce Some Code Repetitions like `(n << amt) >> amt`

This Pull Request is related to [#49937](https://github.com/rust-lang/rust/issues/49937).
This Pull Request has reduced repetition of `(n << amt) >> amt`.

graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust,graydon/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,aidancully/rust,aidancully/rust