Skip to content

improve the Pattern::add_string ergonomics #31

@juhp

Description

@juhp

I feel it would be nice to hide the CStr's from the API here:

pub fn add_string(&mut self, name: &CStr, val: &CStr)

and have a type for the different kinds of key values,
which could then be safely converted internally to an FcPattern.

I am imagining a safe type something like

pub enum PatternKeyValue =
    Family: &str,
    Style: &str,
    :
    Lang: &str,
    Charset: u32,
    :
    Variable: bool;
    :

Any thoughts?

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