Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small error in documentation #118

Closed
Davilink opened this issue Aug 16, 2024 · 1 comment
Closed

Small error in documentation #118

Davilink opened this issue Aug 16, 2024 · 1 comment

Comments

@Davilink
Copy link

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

@SergioBenitez
Copy link
Owner

Good catch! I think I meant to have foo_bar as an original env var here. Fixing now.

SergioBenitez added a commit that referenced this issue Aug 17, 2024
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

No branches or pull requests

2 participants