-
Notifications
You must be signed in to change notification settings - Fork 255
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
Unclear path substition rules #1464
Comments
so bottom line is only path segments are compared for matching. On the other hand side, the replacement must be an absolute path. It'd be great to get this documented. |
Sorry for the slow response! I think the solution to this would be to extend the docs here a little: https://docs.rs/subxt/0.34.0/subxt/attr.subxt.html#substitute_typepath---with-- Here we could note that the replacement path must be absolute (IIRC this is so that it is unambiguous, because the macro doesn't know in which path it's being called, but I'd have to check). It does already mention that it substitutes based on paths I think with "replaces any reference to the generated type at the path given by path with a reference to the path given by with" but perhaps we could make this clearer? I think it'd be nice to also add here an example of how one can avoid using this attribute in some cases (the usual pattern here is to create a custom type and then Do you have any other thoughts on what we could clarify/tweak @drahnr? |
hi, can i take on this ? |
@mahmudsudo you're very welcome to contribute some better docs for this :) |
ok on it |
It is not clear how to specify the substitute
syn::Path
s required as argument.A few things remain puzzling:
Ident
) themselves suffice for matching?is the relevant line, but it's not clear what
path.segments
contains and relative to what base.The text was updated successfully, but these errors were encountered: