Programming Pearls -- Column 1: Sorting unique numbers with bitfield
use declarations
use std::env;
use std::fs::File;
use std::io::*;

That's a sneaky way to import io::{Error, Result}.  For the sake of
readability, it may be beneficial to spell out io:: each time.  Also
see the Error handling section below.
use declarations can be condensed.  For example:
use std::{env, fs::File, io};

Allocation
let args: Vec&lt;_&gt; = env::args().skip(1).collect();

This is an unnecessary allocation.  The main function can be
rewritten in terms of iterators using peekable:
fn main() -&gt; Result&lt;()&gt; {
    // ...

    let mut args = env::args().skip(1).peekable();

    if args.peek().is_none() {
        // read from stdin
    }

    for arg in args {
        // handle arg
    }

    // ...
}

Error handling
Instead of unwrapping the result of parse, you can propagate the
error.
For a larger program, I would suggest using the anyhow crate
for error handling, which reduces a lot of boilerplate.
Miscellaneous
Don't write return Ok(()); at the end of a function — just use
Ok(()).
I think you meant &gt;= here: if num &gt; MAXNUM.
In print_sorted, you wrap the writer in a BufWriter.  What if the
writer is already buffered?  I would leave the decision to the caller.
You can use let mut bitfield = [0_u8; MAXNUM &gt;&gt; 3]; for less
duplication.
Using a crate like bit-set might be good for readability.