diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:03 +0000 |
commit | 64d98f8ee037282c35007b64c2649055c56af1db (patch) | |
tree | 5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /vendor/clap_derive/src/utils/spanned.rs | |
parent | Adding debian version 1.67.1+dfsg1-1. (diff) | |
download | rustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip |
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/clap_derive/src/utils/spanned.rs')
-rw-r--r-- | vendor/clap_derive/src/utils/spanned.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/vendor/clap_derive/src/utils/spanned.rs b/vendor/clap_derive/src/utils/spanned.rs index 11415f6f0..339a654e6 100644 --- a/vendor/clap_derive/src/utils/spanned.rs +++ b/vendor/clap_derive/src/utils/spanned.rs @@ -5,7 +5,7 @@ use syn::LitStr; use std::ops::{Deref, DerefMut}; /// An entity with a span attached. -#[derive(Debug, Clone)] +#[derive(Debug, Copy, Clone)] pub struct Sp<T> { val: T, span: Span, @@ -16,11 +16,8 @@ impl<T> Sp<T> { Sp { val, span } } - pub fn call_site(val: T) -> Self { - Sp { - val, - span: Span::call_site(), - } + pub fn get(&self) -> &T { + &self.val } pub fn span(&self) -> Span { |