Skip to content

Commit

Permalink
Remove spanned (#9)
Browse files Browse the repository at this point in the history
Changes:
- Remove `DeprecatedWarningBuilder::spanned`. Something with the `syn`
features is getting messed up, so just deleting it.

Signed-off-by: Oliver Tale-Yazdi <[email protected]>
  • Loading branch information
ggwpez authored Oct 8, 2023
1 parent d8c71a2 commit d041327
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
8 changes: 1 addition & 7 deletions proc-macro-warning/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use core::ops::Deref;
use proc_macro2::Span;
use quote::{quote_spanned, ToTokens};
use syn::{spanned::Spanned, Ident};
use syn::Ident;

mod test;

Expand Down Expand Up @@ -160,12 +160,6 @@ impl DeprecatedWarningBuilder {
Self { span: Some(span), ..self }
}

/// Set the span of the warning to the span of `s`.
#[must_use]
pub fn spanned<S: Spanned>(self, spanned: S) -> Self {
Self { span: Some(spanned.span()), ..self }
}

/// Fallibly build a warning.
pub fn maybe_build(self) -> Result<Warning, String> {
let span = self.span.unwrap_or_else(Span::call_site);
Expand Down
9 changes: 0 additions & 9 deletions proc-macro-warning/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,6 @@ fn type_inferring_into_string_works() {
test_into_string_inference!(Warning::new_deprecated("").help_link);
}

/// Check the functions that accepting `Spanned` work as expected.
#[test]
fn type_inferring_spanned_works() {
let ident = syn::Ident::new("foo", proc_macro2::Span::call_site());

let _ = Warning::new_deprecated("").spanned(&ident);
let _ = Warning::new_deprecated("").spanned(ident);
}

#[test]
#[cfg(feature = "derive_debug")]
fn warning_debug_works() {
Expand Down

0 comments on commit d041327

Please sign in to comment.