all: update repo to use the new error handling syntax (#8950)

This commit is contained in:
spaceface 2021-02-28 21:20:21 +01:00 committed by GitHub
parent b9a381f101
commit d63b7bc35a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
135 changed files with 487 additions and 468 deletions

View file

@ -110,7 +110,7 @@ pub fn (mut d Digest) checksum() []byte {
tmp[0] = 0x80
pad := ((55 - d.len) % 64) // calculate number of padding bytes
binary.little_endian_put_u64(mut tmp[1 + pad..], d.len << 3) // append length in bits
d.write(tmp[..1 + pad + 8]) or { panic(err) }
d.write(tmp[..1 + pad + 8]) or { panic(err.msg) }
// The previous write ensures that a whole number of
// blocks (i.e. a multiple of 64 bytes) have been hashed.
if d.nx != 0 {
@ -127,7 +127,7 @@ pub fn (mut d Digest) checksum() []byte {
// sum returns the MD5 checksum of the data.
pub fn sum(data []byte) []byte {
mut d := new()
d.write(data) or { panic(err) }
d.write(data) or { panic(err.msg) }
return d.checksum()
}