mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-24 00:52:18 +01:00
Fix some hasher methods' effects
This commit is contained in:
1 parent
131732e7eb
commit
dfc8e14f4f
4 files changed
+6
-7
No files matched your search
@@ -19,8 +19,7 @@ pub struct hasher?(
|
||||
state base.u32 = 1,
|
||||
)
|
||||
|
||||
// TODO: add a ! as this function is impure.
|
||||
pub func hasher.update(x slice base.u8)(checksum base.u32) {
|
||||
pub func hasher.update!(x slice base.u8)(checksum base.u32) {
|
||||
// The Adler-32 checksum's magic 65521 and 5552 numbers are discussed in
|
||||
// RFC 1950.
|
||||
|
||||
@@ -45,6 +44,8 @@ pub func hasher.update(x slice base.u8)(checksum base.u32) {
|
||||
in.x = remaining
|
||||
}
|
||||
|
||||
// TODO: check that you can't assign to this.foo unless the method's effect
|
||||
// is "!" impure or "?" impure coroutine.
|
||||
this.state = ((s2 & 0xFFFF) << 16) | (s1 & 0xFFFF)
|
||||
return this.state
|
||||
}
|
||||
Reference in new issue
Block a user