diff options
| author | David Thomas <david2005thomas@gmail.com> | 2024-02-17 13:36:00 +0000 |
|---|---|---|
| committer | GnomedDev <david2005thomas@gmail.com> | 2024-02-18 17:58:52 +0000 |
| commit | dbb15fb45d45615b443f3fbf009af047719005ff (patch) | |
| tree | 97756ecf35c8e82c412d3e7e6de9d63f1a4d5da6 /library/std/src/sys/pal/solid | |
| parent | 04334394337e19e632eba32ae1dfd554f5831b42 (diff) | |
Dyn erase at call site
Diffstat (limited to 'library/std/src/sys/pal/solid')
| -rw-r--r-- | library/std/src/sys/pal/solid/os.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/library/std/src/sys/pal/solid/os.rs b/library/std/src/sys/pal/solid/os.rs index ff81544ba91..5ceab3b27e0 100644 --- a/library/std/src/sys/pal/solid/os.rs +++ b/library/std/src/sys/pal/solid/os.rs @@ -172,7 +172,7 @@ pub fn env() -> Env { pub fn getenv(k: &OsStr) -> Option<OsString> { // environment variables with a nul byte can't be set, so their value is // always None as well - run_with_cstr(k.as_bytes(), |k| { + run_with_cstr(k.as_bytes(), &|k| { let _guard = env_read_lock(); let v = unsafe { libc::getenv(k.as_ptr()) } as *const libc::c_char; @@ -190,8 +190,8 @@ pub fn getenv(k: &OsStr) -> Option<OsString> { } pub fn setenv(k: &OsStr, v: &OsStr) -> io::Result<()> { - run_with_cstr(k.as_bytes(), |k| { - run_with_cstr(v.as_bytes(), |v| { + run_with_cstr(k.as_bytes(), &|k| { + run_with_cstr(v.as_bytes(), &|v| { let _guard = ENV_LOCK.write(); cvt_env(unsafe { libc::setenv(k.as_ptr(), v.as_ptr(), 1) }).map(drop) }) @@ -199,7 +199,7 @@ pub fn setenv(k: &OsStr, v: &OsStr) -> io::Result<()> { } pub fn unsetenv(n: &OsStr) -> io::Result<()> { - run_with_cstr(n.as_bytes(), |nbuf| { + run_with_cstr(n.as_bytes(), &|nbuf| { let _guard = ENV_LOCK.write(); cvt_env(unsafe { libc::unsetenv(nbuf.as_ptr()) }).map(drop) }) |
