How to: Libraries and No-Std

In addition to what @jofas said also notice, that if your library doesn't need OS, but could benefit from dynamic allocation, then you can just add alloc feature, that will enable the alloc crate. And then in your code you can import collections, smart pointers, etc. from alloc instead of std.

In both cases you can also benefit from enabling following clippy lints:

Which will warn you, when you are importing items from "more restricted" crates and thus limiting your library's functionality, when you could import them from the "less restricted" ones.