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

crate does not re-export bstr, therefore requires users to add this dependency #12

Closed
pickx opened this issue Apr 12, 2024 · 1 comment · Fixed by #14
Closed

crate does not re-export bstr, therefore requires users to add this dependency #12

pickx opened this issue Apr 12, 2024 · 1 comment · Fixed by #14

Comments

@pickx
Copy link

pickx commented Apr 12, 2024

hey, on my machine this example

use unfmt::unformat;

fn main() {
    unformat!("hello", world);
}

in Cargo.toml:

[dependencies]
unfmt = { git = "https://github.com/mathematic-inc/unfmt.git" }

...results in

error[E0432]: unresolved import `bstr`

I believe this is because the macro expansion includes use ::bstr::{ByteSlice, BStr};.
this means a user would need to add bstr as a dependency - see this Stack Overflow question.

afaik, there are ways to deal with this, such as re-exporting.

@jrandolf
Copy link
Contributor

jrandolf commented Apr 12, 2024

Looks like there is no solution to this at the moment. See rust-lang/rust#54363

We recommend just adding bstr as a dependency as the usage by this library is zero-cost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants