mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
Fix up some unnecessary uses of unsafe
.
This commit is contained in:
parent
da02dba979
commit
94dec69247
8 changed files with 208 additions and 226 deletions
|
@ -105,7 +105,7 @@ fn read_block<R: Read>(reader: &mut R) -> Result<ReadResult, ()> {
|
|||
|
||||
match reader.read(&mut buf) {
|
||||
Ok(len) if len > 0 => {
|
||||
unsafe { buf.set_len(len); }
|
||||
buf.truncate(len);
|
||||
Ok(ReadResult::Payload(buf))
|
||||
}
|
||||
Ok(_) => Ok(ReadResult::EOF),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue