Skip to content

Potentially a useful way to tame lifetimes: SharedBytes #558

@icefoxen

Description

@icefoxen

SharedBytes is a type used in rusttype, documented here: https://docs.rs/rusttype/0.2.1/rusttype/enum.SharedBytes.html

This lets all of rusttype's structs, such as FontCollection and Glyph, use the same interface for owned and unowned backing stores. Instead of taking a &'a [u8] they just take Into<SharedBytes<'a>>.

Something like this might make it easier to avoid issues such as andelf/rust-sdl2_ttf#29 , andelf/rust-sdl2_ttf#29 , and anything that uses a RWops (#535 was not the panacea I was hoping it would be).

Just something that might be worth considering.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions