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

Convert from Arc<str> #19

Open
oovm opened this issue Mar 7, 2024 · 1 comment
Open

Convert from Arc<str> #19

oovm opened this issue Mar 7, 2024 · 1 comment

Comments

@oovm
Copy link

oovm commented Mar 7, 2024

Arc<str> type cannot call to_case, you need to convert .as_ref() to &str first.

error[E0599]: the method `to_case` exists for struct `Arc<str>`, but its trait bounds were not satisfied
   --> projects\src\variants\codegen.rs:37:31
    |
37  |           let wasi_alias = name.to_case(Case::Kebab);
    |                                 ^^^^^^^
    |
365 |   pub struct String {
    |   ----------------- doesn't satisfy `_: PartialEq<Arc<str>>`
    |
248 | / pub struct Arc<
249 | |     T: ?Sized,
250 | |     #[unstable(feature = "allocator_api", issue = "32838")] A: Allocator = Global,
251 | | > {
    | |_- doesn't satisfy `std::sync::Arc<str>: Casing<std::sync::Arc<str>>`
    |
    = note: the following trait bounds were not satisfied:
            `std::string::String: PartialEq<std::sync::Arc<str>>`
            which is required by `std::sync::Arc<str>: Casing<std::sync::Arc<str>>`
            `str: Sized`
            which is required by `str: Casing<str>`
@rutrum
Copy link
Owner

rutrum commented Jan 1, 2025

This was a deprecation due to implementing the is_case method, which was written to require the constraint String: PartialEq<T>. This has been rewritten to instead just require ToString which Rc and Arc meet. This will be fixed in the 0.7.0 release. Thank you for bringing this to my attention.

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