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

Allow validation of "string-like" types #176

Open
cortopy opened this issue Nov 24, 2021 · 2 comments
Open

Allow validation of "string-like" types #176

cortopy opened this issue Nov 24, 2021 · 2 comments

Comments

@cortopy
Copy link
Contributor

cortopy commented Nov 24, 2021

I have code for protobuf messages generate with prost, which will be something like

struct Address {
  line1: prost::alloc::string::String
}

for most purposes line1 is just a String and any function that works with one will work with the other.

However, because of the following function

pub fn assert_string_type(name: &str, type_name: &str, field_type: &syn::Type) {

I can't use the derive annotations

Would it be acceptable to write the check as a match for "String"?

@loyd
Copy link

loyd commented May 31, 2022

  • also for CompactString and other strings with SSO

@Keats
Copy link
Owner

Keats commented Jun 3, 2022

This would be fixed by #205

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

3 participants