aboutsummaryrefslogtreecommitdiff
path: root/vendor/miette-derive/src/diagnostic_arg.rs
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2024-07-19 15:37:58 +0300
committerValentin Popov <valentin@popov.link>2024-07-19 15:37:58 +0300
commita990de90fe41456a23e58bd087d2f107d321f3a1 (patch)
tree15afc392522a9e85dc3332235e311b7d39352ea9 /vendor/miette-derive/src/diagnostic_arg.rs
parent3d48cd3f81164bbfc1a755dc1d4a9a02f98c8ddd (diff)
downloadfparkan-a990de90fe41456a23e58bd087d2f107d321f3a1.tar.xz
fparkan-a990de90fe41456a23e58bd087d2f107d321f3a1.zip
Deleted vendor folder
Diffstat (limited to 'vendor/miette-derive/src/diagnostic_arg.rs')
-rw-r--r--vendor/miette-derive/src/diagnostic_arg.rs42
1 files changed, 0 insertions, 42 deletions
diff --git a/vendor/miette-derive/src/diagnostic_arg.rs b/vendor/miette-derive/src/diagnostic_arg.rs
deleted file mode 100644
index bade6f0..0000000
--- a/vendor/miette-derive/src/diagnostic_arg.rs
+++ /dev/null
@@ -1,42 +0,0 @@
-use syn::parse::{Parse, ParseStream};
-
-use crate::code::Code;
-use crate::forward::Forward;
-use crate::help::Help;
-use crate::severity::Severity;
-use crate::url::Url;
-
-pub enum DiagnosticArg {
- Transparent,
- Code(Code),
- Severity(Severity),
- Help(Help),
- Url(Url),
- Forward(Forward),
-}
-
-impl Parse for DiagnosticArg {
- fn parse(input: ParseStream) -> syn::Result<Self> {
- let ident = input.fork().parse::<syn::Ident>()?;
- if ident == "transparent" {
- // consume the token
- let _: syn::Ident = input.parse()?;
- Ok(DiagnosticArg::Transparent)
- } else if ident == "forward" {
- Ok(DiagnosticArg::Forward(input.parse()?))
- } else if ident == "code" {
- Ok(DiagnosticArg::Code(input.parse()?))
- } else if ident == "severity" {
- Ok(DiagnosticArg::Severity(input.parse()?))
- } else if ident == "help" {
- Ok(DiagnosticArg::Help(input.parse()?))
- } else if ident == "url" {
- Ok(DiagnosticArg::Url(input.parse()?))
- } else {
- Err(syn::Error::new(
- ident.span(),
- "Unrecognized diagnostic option",
- ))
- }
- }
-}