- Dec 16, 2021
-
-
Simon Sapin authored
-
Simon Sapin authored
-
Simon Sapin authored
-
Simon Sapin authored
This hack was only useful to support Rust versions older than 1.45 A macro_rules wrapper for the `write_bytes` proc macro is still used in order to have it hold the doc-comment, as the doc-test requires items from the main non-proc-macro crate.
-
Simon Sapin authored
This is the version in Debian Bullseye, now stable instead Buster which had 1.14.1. Let’s treat this as a SemVer-breaking change, since this would break any remaining users with old compilers.
-
- Apr 30, 2021
-
-
Raphaël Gomès authored
-
- Mar 08, 2021
-
-
Simon Sapin authored
-
- Mar 04, 2021
-
-
Simon Sapin authored
-
- Feb 08, 2021
-
-
Simon Sapin authored
-
Simon Sapin authored
-
Simon Sapin authored
# Background Because it’s a macro that can expand to multiple "write" calls, `write_bytes!` assigns the output stream parameter expression to an internal binding in order to avoid evaluating multiple times an expression that could have side-effects. To avoid taking ownership of the stream away from the caller, before this change it took a `&mut $expression` borrow and assigned that. However when the expression is another local binding, that required the binding to be `mut` even if it already had a `&mut _` type as is typically the case inside implementations of the `DisplayBytes` trait. This caused signatures that look redundant, using the `mut` keyword twice: `mut out: &mut dyn Write`. # Change `write_bytes!` now requires the output stream expression to already be a `&mut _` borrow, and assigns that to an internal binding. This is less flexible for callers (and therefore a breaking change) but matches how functions and methods work (auto-ref applies to recievers of method calls but not other arguments), and allows `DisplayBytes` impls to have the less redundant `out: &mut dyn Write` signature.
-
Simon Sapin authored
write_bytes currently requires the local binding for the output stream to be `mut`, even if it has type `&mut _`
-
- Feb 06, 2021
-
-
Simon Sapin authored
-
- Feb 05, 2021
-
-
Simon Sapin authored
In particular for `T = [u8]`
-
Simon Sapin authored
-
- Feb 04, 2021
-
-
Simon Sapin authored
-
Simon Sapin authored
-
Simon Sapin authored
-
Simon Sapin authored
-
Simon Sapin authored
-
- Nov 26, 2020
-
-
Raphaël Gomès authored
-
Raphaël Gomès authored
This should really be a better error, but I think the better long-term solution is to define a `DisplayBytes` trait or something similar and use that.
-
Raphaël Gomès authored
This ensure that the macro work no matter how large the format bytestring is in version of Rust < 1.47.
-
Raphaël Gomès authored
-
- Jan 19, 2021
-
-
Simon Sapin authored
`format_bytes!` now accepts any argument that implements `DisplayBytes`, not just byte strings. `write_bytes!` is to `format_bytes!` what the standard library’s `write!` is to `format!`: it can write to any stream given as an additional first argument.
-
- Jan 20, 2021
-
-
Simon Sapin authored
Similar to `std::fmt::Display` but writes to `std::io::Write` instead of `std::fmt::Write`.
-
- Jan 19, 2021
-
-
Simon Sapin authored
-
- Nov 19, 2020
-
-
Raphaël Gomès authored
-
Raphaël Gomès authored
-
Raphaël Gomès authored
-
Raphaël Gomès authored
-
Raphaël Gomès authored
-
Raphaël Gomès authored
Debian stable has had this version for a while now
-
Raphaël Gomès authored
-
Raphaël Gomès authored
This highlights a very simple and dumb bug.
-
- Jun 23, 2020
-
-
Raphaël Gomès authored
-