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

improve rspc integration #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

oscartbeaumont
Copy link

@oscartbeaumont oscartbeaumont commented Jul 9, 2024

This does some improvement to the rspc integration.

Changes:

  • Depend on specta::Type not rspc::Type as rspc::Type is a reexport. This would allow your library to be used with any other Specta related library easily.

@@ -23,7 +23,7 @@ pub struct Parser {}
type ParseResult<T> = Result<(T, Vec<ParseErrorDetails>), ParseErrorDetails>;

impl Parser {
pub const REST_FILE_EXTENSIONS: [&str; 2] = ["http", "rest"];
pub const REST_FILE_EXTENSIONS: [&'static str; 2] = ["http", "rest"];
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a heads up this changed is inspired by the compiler output.

➜ cargo check --all --all-features
warning: `&` without an explicit lifetime name cannot be used here
  --> src/parser.rs:26:38
   |
26 |     pub const REST_FILE_EXTENSIONS: [&str; 2] = ["http", "rest"];
   |                                      ^
   |
   = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
   = note: for more information, see issue #115010 <https://github.com/rust-lang/rust/issues/115010>
   = note: `#[warn(elided_lifetimes_in_associated_constant)]` on by default
help: use the `'static` lifetime
   |
26 |     pub const REST_FILE_EXTENSIONS: [&'static str; 2] = ["http", "rest"];
   |

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

Successfully merging this pull request may close these issues.

1 participant