Reading with serialport crate get wrong/incomplete data

Hello all, I'm using the serialport crate to read data from a serial port in a Linux machine. It looks like data are read fine except at the end, where I have a wrong and/or missing byte. For example, here's the frames I send (hex format):

01 03 00 00 00 01 84 0a 
01 03 00 00 00 01 84 0a 
01 03 00 00 00 01 84 0a 
01 03 00 06 00 01 64 0b 
01 03 00 01 00 02 95 cb 
01 03 00 00 00 01 0a 84 

And here's the frame I receive (base 10):

msg: [1, 3, 0, 0, 0, 1, 132, 10]
msg: [1, 3, 0, 0, 0, 1, 132, 10]
msg: [1, 3, 0, 0, 0, 1, 132, 10]
msg: [1, 3, 0, 6, 0, 1, 100, 11]
msg: [1, 3, 0, 1, 0, 2, 149, 203]
msg: [1, 3, 0, 0, 0, 1, 10, 255]

As you can see, the last byte is wrong, I expect 0x84/132, but I get 0xFF/255

Another case, I send:

03 03 00 00 00 01 85 e8 
03 03 00 00 00 01 85 e8 
03 03 00 00 00 01 85 e8 
03 03 00 06 00 01 65 e9 
03 03 00 01 00 02 94 29 
03 03 00 00 00 01 e8 85 

and receive

msg: [3, 3, 0, 0, 0, 1, 133, 232]
msg: [3, 3, 0, 0, 0, 1, 133, 232]
msg: [3, 3, 0, 0, 0, 1, 133, 232]
msg: [3, 3, 0, 6, 0, 1, 101, 233]
msg: [3, 3, 0, 1, 0, 2, 148, 41]
msg: [3, 3, 0, 0, 0, 1, 21]

In this case the last byte (21) is wrong and moreover, I missed a byte.
Now, my code:

use serialport::TTYPort;

let port = serialport::new(port, 9_600)
	.parity(serialport::Parity::None)
	.data_bits(serialport::DataBits::Eight)
	.stop_bits(serialport::StopBits::One)
	.flow_control(serialport::FlowControl::None)
	.timeout(Duration::from_millis(10))
	.open_native();
	...
loop {
	let mut buf = [0 as u8; 256];
	let mut msg: Vec<u8> = Vec::new();
	let mut n_bytes = 1;
	while n_bytes > 0 {
		n_bytes = match port.read(&mut buf) {
			Ok(n) => n,
			Err(_) => { break; },
		};
		msg.extend_from_slice(&buf[0..n_bytes]);
	}

	if msg.len() <= 0 {
		continue;
	}

	println!("msg: {:?}", msg);
}

This is probably not the problem, but you should print the error instead of completely ignoring it, in case it's relevant.