Skip to content

Should the usage of {Option, Result}::expect be avoided to safe memory?  #42

Closed
@XOSplicer

Description

@XOSplicer

Currently there are a few functions that use {Option, Result}::expect because there is no way to return Option or Result. Examples are LinearMap::{index, index_mut} , Vec::from_iter and IndexMap::index.

AFIK the messages that are associated with them are statically allocated in the data section of the binary and therefore take up space, even if no panic actualy can occure.

As this library is used with microcontrollers, should those strings be removed?
I don't know if rust is smart enough to remove them from the binary by itself.

However some clarity in panic messages would be sacrificed in exchange for it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions