// buf_len: Option<usize>
let buf_len = buf_len.and_then(|n| Some(n * 1048576)).unwrap_or(16 * 1048576);
let buf_len = buf_len.unwrap_or(16) * 1048576;
If buf_len is None, the one above seems to be more efficient because the value of 16 * 1048576 is obviously already calculated at compile time. But the following one is much more natural and concise, and I would prefer to write the following one if the compiler can optimize it.
Actually, you likely shouldn't have worried about this in the first place. Since you are referring to some sort of buffer, you are likely doing I/O. The cost of an integer multiplication is going to be dwarfed by any sort of I/O, by several orders of magnitude. Even if the compiler couldn't optimize the simpler code, it wouldn't even matter, because it wouldn't make your program even noticeably slower.