Skip to content

Conversation

@LordRatte
Copy link

A suggested solution for #14

@LordRatte
Copy link
Author

To visualise how it works, let's take an example of the generated, intermediate code.

...

static PROJECT_DIR: Dir =
    include_dir::Dir::new("",
        &[include_dir::DirEntry::File(include_dir::File::new("a",
                            b"12345678910\n12345678910\n12345678910\n12345678910\n12345678910\n12345678910\n12345678910\n12345678910\n12345678910\n12345678910\n"))]);

fn main() {
    PROJECT_DIR.extract(Path::new("./o")).unwrap();
}

Now becomes the following with the feature turned on

...

static PROJECT_DIR: Dir = include_dir::Dir::new(
    "",
    &[include_dir::DirEntry::File(include_dir::File::new(
        "a",
        b"\xcf12345678910\n\x0c\x00Y\x00",
    ))],
);

fn main() {
    PROJECT_DIR.extract(Path::new("./o")).unwrap();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant