Skip to content
Snippets Groups Projects
  1. Mar 12, 2018
    • Carl Lerche's avatar
      Fix `copy_to_slice` to use correct increment var · ebe52273
      Carl Lerche authored
      This patch fixes the `copy_to_slice` function, rectifying the logic.
      However, the incorrect code does not result in incorrect behavior as the
      only case `cnt != src.len()` is during the final iteration, and since
      `src.len()` is greater than `cnt` in that case, `off` will be
      incremented by too much, but this will still trigger the `off <
      dst.len()` condition.
      
      The only danger is `src.len()` could cause an overflow.
      ebe52273
    • Sean McArthur's avatar
      Remove ByteOrder generic methods from Buf and BufMut (#187) · 025d5334
      Sean McArthur authored
      * make Buf and BufMut usable as trait objects
      
      - All the `get_*` and `put_*` methods that take `T: ByteOrder` have
        a `where Self: Sized` bound added, so that they are only usable from
        sized types. It was impossible to make `Buf` or `BufMut` into trait
        objects before, so this change doesn't break anyone.
      - Add `get_n_be`/`get_n_le`/`put_n_be`/`put_n_le` methods that can be
        used on trait objects.
      - Deprecate the export of `ByteOrder` and methods generic on it.
      
      * remove deprecated ByteOrder methods
      
      Removes the `_be` suffix from all methods, implying that the default
      people should use is network endian.
      025d5334
    • Sean McArthur's avatar
      Make Buf and BufMut usable as trait objects (#186) · ce79f0a2
      Sean McArthur authored
      - All the `get_*` and `put_*` methods that take `T: ByteOrder` have
        a `where Self: Sized` bound added, so that they are only usable from
        sized types. It was impossible to make `Buf` or `BufMut` into trait
        objects before, so this change doesn't break anyone.
      - Add `get_n_be`/`get_n_le`/`put_n_be`/`put_n_le` methods that can be
        used on trait objects.
      - Deprecate the export of `ByteOrder` and methods generic on it.
      
      Fixes #163 
      ce79f0a2
  2. Jan 26, 2018
  3. Mar 16, 2017
  4. Mar 07, 2017
    • Carl Lerche's avatar
      Remove buf::Source in favor of buf::IntoBuf · 06b94c55
      Carl Lerche authored
      The `Source` trait was essentially covering the same case as `IntoBuf`,
      so remove it.
      
      While technically a breaking change, this should not have any impact due
      to:
      
      1) There are no reverse dependencies that currently depend on `bytes`
      2) Source was not supposed to be implemented externally
      3) IntoBuf provides the same implementations as `Source`
      
      Given these points, the change should be safe to apply.
      06b94c55
  5. Mar 02, 2017
  6. Mar 01, 2017
  7. Feb 28, 2017
Loading