Skip to content
This repository was archived by the owner on Jul 23, 2024. It is now read-only.
This repository was archived by the owner on Jul 23, 2024. It is now read-only.

Should image-core be no_std #4

@197g

Description

@197g

The discussion in image#1184 made me realized that the naming image-core might imply that the crate actually only depends on core. Since this is not already the case, it's liky a very good idea to follow regardless. As a very first step it would help if it were at least clear what features require which standard dependency. This also surfaces some other questions:

  • The error type has a variant for io::Error. We, ourselves, had misused that variant a couple of times until 0.23 which had made the switch more painful than necessary. It's also preventing us from developing our own error type independently and not particularly accurate. Why should it be possible that copying an image buffer results in an IO error?. As also mentioned in this blog post about sled it is also not very ergonomic when one considers that io errors are possibly more fatal to a program than wrong data.

  • ImageDecoder locks all implementors into returning ImageError. This crates a close dependency between the error type and decoding functionality, possibly a lot closer than necessary.

  • The ImageFormat::from_path functionality relies on Path which is only available in std as it is (somewhat) OS-dependent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions