moulins
moulins
Shrink WString to 16 bytes on 64-bits targets by introducing an explicit `WStrMetadata` type that is always 4 bytes wide, even on 64-bits targets. Note the trickier logic in `WString::from_buf`,...
The following snippet: ```rust fn main() { use std::io::Write; let buf = Vec::new(); let mut file = flate2::write::ZlibEncoder::new(buf, flate2::Compression::best()); file.write_all(b"Hello world!").unwrap(); file.flush().unwrap(); println!("reported size: {}", file.total_out()); println!("actual size: {}", file.finish().unwrap().len());...
The following Rust code: ```rs let _ = rslint_parser::parse_text_lossy("var foo = (c>>10);", 0); ``` panics with: ``` 'slice index starts at 8 but ends at 2', ~/.cargo/registry/src/github.com-1ecc6299db9ec823/rslint_parser-0.3.1/src/lossy_tree_sink.rs:36:13 ``` -------------- The...
This RFC proposes to add niches to reference-like types by exploiting unused bit patterns caused by alignment requirements. [Rendered](https://github.com/moulins/rfcs/blob/6ec77d55147d7c06ece56e2a44ddee56ee8b5cf4/text/3204-references-alignment-niches.md) [Previous discussion on IRLO](https://internals.rust-lang.org/t/pre-rfc-add-alignment-niches-for-references/15693)
When downloading to the filesystem, retrieve the `Last-Modified` date from the HTTP headers and use it to set the on-disk `mtime` of the downloaded file. I've implemented this unconditionally, but...
Implements (mostly) the changes discussed in https://github.com/kyren/gc-arena/pull/105#issuecomment-2225971064. A small difference: I ditched the `CollectFlags` abstraction in favor of keeping a simple boolean; this makes the trait slightly less cumbersome to...
The `Frame`s returned by `AnimationDecoder` are hardcoded to contain `Rgba8Image`s, which is generally suboptimal when working with animated PNG or WEBP images: - if the source image has no alpha...
An "evil" type can implement `AsRef` and `Into` in inconsistent ways, which allows constructing a non-ASCII `AsciiString`: ```rs use ascii::AsciiString; struct EvilString(String); impl AsRef for EvilString { fn as_ref(&self) ->...
# Proposal ## Problem statement Add a way to write formatted data to a `Vec` (instead of a `String`). The "straightforward" solution of implementing `fmt::Write` for `Vec` would risk causing...
Closes #108 by expanding `span_location!` to allow overriding source locations: ```rs let location: &'static SpanLocation = span_location! { name: "another name", function: "my::fake::function", file: "path/to/fake/file.rs", line: 42, color: 0x99CC66, //...