These reviews are from cargo-vet. To add your review, set up cargo-vet and submit your URL to its registry.

The current version of known-folders is 1.2.0.

1.0.1 (older version) safe-to-deploy

From zcash/rust-ecosystem copy of zcash/zcash. By str4d.

Uses unsafe blocks to interact with windows-sys crate.

  • SHGetKnownFolderPath safety requirements are met.
  • CoTaskMemFree has no effect if passed NULL, so there is no issue if some future refactor created a pathway where ffi::Guard could be dropped before SHGetKnownFolderPath is called.
  • Small nit: ffi::Guard::as_pwstr takes &self but returns PWSTR which is the mutable type; it should instead return PCWSTR which is the const type (and what lstrlenW takes) instead of implicitly const-casting the pointer, as this would better reflect the intent to take an immutable reference.
  • The slice constructed from the PWSTR correctly goes out of scope before guard is dropped.
  • A code comment says that path_ptr is valid for len bytes, but PCWSTR is a *const u16 and lstrlenW returns its length "in characters" (which the Windows documentation confirms means the number of WCHAR values). This is likely a typo; the code checks that len * size_of::<u16>() <= isize::MAX.

cargo-vet does not verify reviewers' identity. You have to fully trust the source the audits are from.

safe-to-deploy (implies safe-to-run)

This crate will not introduce a serious security vulnerability to production software exposed to untrusted input. More…

safe-to-run
Implied by other criteria

This crate can be compiled, run, and tested on a local workstation or in controlled automation without surprising consequences. More…


Lib.rs has been able to verify that all files in the crate's tarball, except Cargo.lock, are in the crate's repository with a git tag matching the version. Please note that this check is still in beta, and absence of this confirmation does not mean that the files don't match.

Crates in the crates.io registry are tarball snapshots uploaded by crates' publishers. The registry is not using crates' git repositories, so there is a possibility that published crates have a misleading repository URL, or contain different code from the code in the repository.

To review the actual code of the crate, it's best to use cargo crev open known-folders. Alternatively, you can download the tarball of known-folders v1.2.0 or view the source online.