Furthermore, the `Debug` trait was added.
Unified · Split
| @@ -3,6 +3,7 @@ use std::fmt; · 2 unmodified lines | |||
| 3 | use bstr::{BStr, BString, ByteVec}; | 3 | use bstr::{BStr, BString, ByteVec}; |
| 4 | 4 | ||
| 5 | /// The arguments passed to a server command. | 5 | /// The arguments passed to a server command. |
| 6 | #[derive(Debug)] | ||
| 6 | pub struct Arguments { | 7 | pub struct Arguments { |
| 7 | /// The active features/capabilities of the fetch invocation | 8 | /// The active features/capabilities of the fetch invocation |
| 8 | #[cfg(any(feature = "async-client", feature = "blocking-client"))] | 9 | #[cfg(any(feature = "async-client", feature = "blocking-client"))] |
| @@ -24,6 +25,13 @@ pub struct Arguments { · 15 unmodified lines | |||
| 24 | } | 25 | } |
| 25 | 26 | ||
| 26 | impl Arguments { | 27 | impl Arguments { |
| 28 | /// Return true if there is no argument at all. | ||
| 29 | /// | ||
| 30 | /// This can happen if callers assure that they won't add 'wants' if their 'have' is the same, i.e. if the remote has nothing | ||
| 31 | /// new for them. | ||
| 32 | pub fn is_empty(&self) -> bool { | ||
| 33 | self.args.is_empty() | ||
| 34 | } | ||
| 27 | /// Return true if ref filters is supported. | 35 | /// Return true if ref filters is supported. |
| 28 | pub fn can_use_filter(&self) -> bool { | 36 | pub fn can_use_filter(&self) -> bool { |
| 29 | self.filter | 37 | self.filter |
| @@ -50,7 +50,7 @@ pub mod parse { · 49 unmodified lines | |||
| 50 | pub enum Ref { | 50 | pub enum Ref { |
| 51 | /// A ref pointing to a `tag` object, which in turns points to an `object`, usually a commit | 51 | /// A ref pointing to a `tag` object, which in turns points to an `object`, usually a commit |
| 52 | Peeled { | 52 | Peeled { |
| 53 | /// The name at which the ref is located, like `refs/heads/main`. | 53 | /// The name at which the ref is located, like `refs/tags/1.0`. |
| 54 | full_ref_name: BString, | 54 | full_ref_name: BString, |
| 55 | /// The hash of the tag the ref points to. | 55 | /// The hash of the tag the ref points to. |
| 56 | tag: git_hash::ObjectId, | 56 | tag: git_hash::ObjectId, |