mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-18 03:10:58 +00:00
streams: minor API change
with_limit suggests that the method returns a new StreamReader, instead of mutating self.
This commit is contained in:
parent
83043f7aef
commit
b3c03496e4
@ -38,13 +38,13 @@ class StreamReader:
|
||||
self._buffer = buf
|
||||
self._ofs = ofs
|
||||
|
||||
def with_limit(self, n):
|
||||
def set_limit(self, n):
|
||||
'''
|
||||
Makes this reader to signal EOF after reading `n` bytes.
|
||||
|
||||
Returns the number of bytes that the reader can read after
|
||||
raising EOF (intended to be restored with another call to
|
||||
`with_limit`).
|
||||
`set_limit`).
|
||||
'''
|
||||
if self._limit is not None:
|
||||
rem = self._limit - n
|
||||
|
Loading…
Reference in New Issue
Block a user