Skip to content

Small error in documentation #118

@Davilink

Description

@Davilink

I'm not sure if i'm right or wrong, so that why i didn't create a PR, but i thing there a small error here

/// Jail::expect_with(|jail| {
/// jail.set_env("FOO_FOO", 100);
/// jail.set_env("BAR_FOO", "hi");
/// jail.set_env("foobar", "hi");
///
/// // This is like `prefixed("foo_")` without the filtering.
/// let env = Env::raw().map(|k| match k.starts_with("foo_") {
/// true => k["foo_".len()..].into(),
/// false => k.into()
/// });
///
/// // We now have `FOO=100`, `BAR_FOO=hi`, and `bar=hi`.

I think we should see this at the line 254

// We now have `FOO=100`, `BAR_FOO=hi`, and `foobar=hi`. 

the map in the documentation is looking for something that start with foo_, not just foo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions