Skip to content

Commit 3a339da

Browse files
committed
remove #[momo] directive as it seems to prevent auto-completion in IDEs.
Given it's marginal effect on the binary size, the negative effects on RustRover at least, and the added complexity, I think that ultimately it's not worth keeping, unfortunately.
1 parent 5ac3abb commit 3a339da

File tree

18 files changed

+0
-55
lines changed

18 files changed

+0
-55
lines changed

Cargo.lock

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gix/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,6 @@ cache-efficiency-debug = ["gix-features/cache-efficiency-debug"]
297297

298298

299299
[dependencies]
300-
gix-macros = { version = "^0.1.5", path = "../gix-macros" }
301300
gix-utils = { version = "^0.1.12", path = "../gix-utils" }
302301
gix-fs = { version = "^0.11.2", path = "../gix-fs" }
303302
gix-ref = { version = "^0.45.0", path = "../gix-ref" }

gix/src/config/snapshot/access.rs

-8
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use std::borrow::Cow;
33
use std::ffi::OsStr;
44

55
use gix_features::threading::OwnShared;
6-
use gix_macros::momo;
76

87
use crate::bstr::ByteSlice;
98
use crate::{
@@ -28,7 +27,6 @@ impl<'repo> Snapshot<'repo> {
2827
}
2928

3029
/// Like [`boolean()`][Self::boolean()], but it will report an error if the value couldn't be interpreted as boolean.
31-
#[momo]
3230
pub fn try_boolean<'a>(&self, key: impl Into<&'a BStr>) -> Option<Result<bool, gix_config::value::Error>> {
3331
self.repo.config.resolved.boolean(key.into())
3432
}
@@ -44,23 +42,20 @@ impl<'repo> Snapshot<'repo> {
4442
}
4543

4644
/// Like [`integer()`][Self::integer()], but it will report an error if the value couldn't be interpreted as boolean.
47-
#[momo]
4845
pub fn try_integer<'a>(&self, key: impl Into<&'a BStr>) -> Option<Result<i64, gix_config::value::Error>> {
4946
self.repo.config.resolved.integer(key.into())
5047
}
5148

5249
/// Return the string at `key`, or `None` if there is no such value.
5350
///
5451
/// Note that this method takes the most recent value at `key` even if it is from a file with reduced trust.
55-
#[momo]
5652
pub fn string<'a>(&self, key: impl Into<&'a BStr>) -> Option<Cow<'repo, BStr>> {
5753
self.repo.config.resolved.string(key.into())
5854
}
5955

6056
/// Return the trusted and fully interpolated path at `key`, or `None` if there is no such value
6157
/// or if no value was found in a trusted file.
6258
/// An error occurs if the path could not be interpolated to its final value.
63-
#[momo]
6459
pub fn trusted_path<'a>(
6560
&self,
6661
key: impl Into<&'a BStr>,
@@ -70,7 +65,6 @@ impl<'repo> Snapshot<'repo> {
7065

7166
/// Return the trusted string at `key` for launching using [command::prepare()](gix_command::prepare()),
7267
/// or `None` if there is no such value or if no value was found in a trusted file.
73-
#[momo]
7468
pub fn trusted_program<'a>(&self, key: impl Into<&'a BStr>) -> Option<Cow<'repo, OsStr>> {
7569
let value = self
7670
.repo
@@ -120,7 +114,6 @@ impl<'repo> SnapshotMut<'repo> {
120114

121115
/// Set the value at `key` to `new_value`, possibly creating the section if it doesn't exist yet, or overriding the most recent existing
122116
/// value, which will be returned.
123-
#[momo]
124117
pub fn set_value<'b>(
125118
&mut self,
126119
key: &'static dyn crate::config::tree::Key,
@@ -144,7 +137,6 @@ impl<'repo> SnapshotMut<'repo> {
144137

145138
/// Set the value at `key` to `new_value` in the given `subsection`, possibly creating the section and sub-section if it doesn't exist yet,
146139
/// or overriding the most recent existing value, which will be returned.
147-
#[momo]
148140
pub fn set_subsection_value<'a, 'b>(
149141
&mut self,
150142
key: &'static dyn crate::config::tree::Key,

gix/src/create.rs

-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use std::{
66

77
use gix_config::parse::section;
88
use gix_discover::DOT_GIT_DIR;
9-
use gix_macros::momo;
109

1110
/// The error used in [`into()`].
1211
#[derive(Debug, thiserror::Error)]
@@ -125,7 +124,6 @@ pub struct Options {
125124
/// Note that this is a simple template-based initialization routine which should be accompanied with additional corrections
126125
/// to respect git configuration, which is accomplished by [its callers][crate::ThreadSafeRepository::init_opts()]
127126
/// that return a [Repository][crate::Repository].
128-
#[momo]
129127
pub fn into(
130128
directory: impl Into<PathBuf>,
131129
kind: Kind,

gix/src/discover.rs

-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
use std::path::Path;
33

44
pub use gix_discover::*;
5-
use gix_macros::momo;
65

76
use crate::{bstr::BString, ThreadSafeRepository};
87

@@ -32,7 +31,6 @@ impl ThreadSafeRepository {
3231
/// if the directory that is discovered can indeed be trusted (or else they'd have to implement the discovery themselves
3332
/// and be sure that no attacker ever gets access to a directory structure. The cost of this is a permission check, which
3433
/// seems acceptable).
35-
#[momo]
3634
pub fn discover_opts(
3735
directory: impl AsRef<Path>,
3836
options: upwards::Options<'_>,
@@ -70,7 +68,6 @@ impl ThreadSafeRepository {
7068
/// Consider to set [`match_ceiling_dir_or_error = false`](gix_discover::upwards::Options::match_ceiling_dir_or_error)
7169
/// to allow discovery if an outside environment variable sets non-matching ceiling directories for greater
7270
/// compatibility with Git.
73-
#[momo]
7471
pub fn discover_with_environment_overrides_opts(
7572
directory: impl AsRef<Path>,
7673
mut options: upwards::Options<'_>,

gix/src/init.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#![allow(clippy::result_large_err)]
22
use std::{borrow::Cow, path::Path};
33

4-
use gix_macros::momo;
54
use gix_ref::{
65
store::WriteReflog,
76
transaction::{PreviousValue, RefEdit},
@@ -41,7 +40,6 @@ impl ThreadSafeRepository {
4140
///
4241
/// Fails without action if there is already a `.git` repository inside of `directory`, but
4342
/// won't mind if the `directory` otherwise is non-empty.
44-
#[momo]
4543
pub fn init(
4644
directory: impl AsRef<Path>,
4745
kind: crate::create::Kind,
@@ -58,7 +56,6 @@ impl ThreadSafeRepository {
5856
///
5957
/// Instead of naming the default branch `master`, we name it `main` unless configured explicitly using the `init.defaultBranch`
6058
/// configuration key.
61-
#[momo]
6259
pub fn init_opts(
6360
directory: impl AsRef<Path>,
6461
kind: crate::create::Kind,

gix/src/object/tree/mod.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use gix_hash::ObjectId;
2-
use gix_macros::momo;
32
pub use gix_object::tree::{EntryKind, EntryMode};
43
use gix_object::{bstr::BStr, FindExt, TreeRefIter};
54

@@ -132,7 +131,6 @@ impl<'repo> Tree<'repo> {
132131
///
133132
/// If any path component contains illformed UTF-8 and thus can't be converted to bytes on platforms which can't do so natively,
134133
/// the returned component will be empty which makes the lookup fail.
135-
#[momo]
136134
pub fn lookup_entry_by_path(
137135
&self,
138136
relative_path: impl AsRef<std::path::Path>,
@@ -155,7 +153,6 @@ impl<'repo> Tree<'repo> {
155153
///
156154
/// If any path component contains illformed UTF-8 and thus can't be converted to bytes on platforms which can't do so natively,
157155
/// the returned component will be empty which makes the lookup fail.
158-
#[momo]
159156
pub fn peel_to_entry_by_path(
160157
&mut self,
161158
relative_path: impl AsRef<std::path::Path>,

gix/src/open/repository.rs

-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
use std::{borrow::Cow, path::PathBuf};
33

44
use gix_features::threading::OwnShared;
5-
use gix_macros::momo;
65

76
use super::{Error, Options};
87
use crate::{
@@ -59,7 +58,6 @@ impl ThreadSafeRepository {
5958
///
6059
/// Note that opening a repository for implementing custom hooks is also handle specifically in
6160
/// [`open_with_environment_overrides()`][Self::open_with_environment_overrides()].
62-
#[momo]
6361
pub fn open_opts(path: impl Into<PathBuf>, mut options: Options) -> Result<Self, Error> {
6462
let _span = gix_trace::coarse!("ThreadSafeRepository::open()");
6563
let (path, kind) = {
@@ -113,7 +111,6 @@ impl ThreadSafeRepository {
113111
// GIT_PROXY_SSL_CERT, GIT_PROXY_SSL_KEY, GIT_PROXY_SSL_CERT_PASSWORD_PROTECTED.
114112
// GIT_PROXY_SSL_CAINFO, GIT_SSL_CIPHER_LIST, GIT_HTTP_MAX_REQUESTS, GIT_CURL_FTP_NO_EPSV,
115113
#[doc(alias = "open_from_env", alias = "git2")]
116-
#[momo]
117114
pub fn open_with_environment_overrides(
118115
fallback_directory: impl Into<PathBuf>,
119116
trust_map: gix_sec::trust::Mapping<Options>,

gix/src/pathspec.rs

-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//! Pathspec plumbing and abstractions
2-
use gix_macros::momo;
32
pub use gix_pathspec::*;
43

54
use crate::{bstr::BStr, AttributeStack, Pathspec, PathspecDetached, Repository};
@@ -124,7 +123,6 @@ impl<'repo> Pathspec<'repo> {
124123
alias = "matches_path",
125124
alias = "git2"
126125
)]
127-
#[momo]
128126
pub fn pattern_matching_relative_path<'a>(
129127
&mut self,
130128
relative_path: impl Into<&'a BStr>,
@@ -145,7 +143,6 @@ impl<'repo> Pathspec<'repo> {
145143

146144
/// The simplified version of [`pattern_matching_relative_path()`](Self::pattern_matching_relative_path()) which returns
147145
/// `true` if `relative_path` is included in the set of positive pathspecs, while not being excluded.
148-
#[momo]
149146
pub fn is_included<'a>(&mut self, relative_path: impl Into<&'a BStr>, is_dir: Option<bool>) -> bool {
150147
self.pattern_matching_relative_path(relative_path, is_dir)
151148
.map_or(false, |m| !m.is_excluded())
@@ -180,7 +177,6 @@ impl PathspecDetached {
180177
alias = "matches_path",
181178
alias = "git2"
182179
)]
183-
#[momo]
184180
pub fn pattern_matching_relative_path<'a>(
185181
&mut self,
186182
relative_path: impl Into<&'a BStr>,
@@ -201,7 +197,6 @@ impl PathspecDetached {
201197

202198
/// The simplified version of [`pattern_matching_relative_path()`](Self::pattern_matching_relative_path()) which returns
203199
/// `true` if `relative_path` is included in the set of positive pathspecs, while not being excluded.
204-
#[momo]
205200
pub fn is_included<'a>(&mut self, relative_path: impl Into<&'a BStr>, is_dir: Option<bool>) -> bool {
206201
self.pattern_matching_relative_path(relative_path, is_dir)
207202
.map_or(false, |m| !m.is_excluded())

gix/src/reference/edits.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
///
22
#[allow(clippy::empty_docs)]
33
pub mod set_target_id {
4-
use gix_macros::momo;
54
use gix_ref::{transaction::PreviousValue, Target};
65

76
use crate::{bstr::BString, Reference};
@@ -30,7 +29,6 @@ pub mod set_target_id {
3029
/// If multiple reference should be changed, use [`Repository::edit_references()`][crate::Repository::edit_references()]
3130
/// or the lower level reference database instead.
3231
#[allow(clippy::result_large_err)]
33-
#[momo]
3432
pub fn set_target_id(
3533
&mut self,
3634
id: impl Into<gix_hash::ObjectId>,

gix/src/reference/iter.rs

-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#![allow(clippy::empty_docs)]
33
use std::path::Path;
44

5-
use gix_macros::momo;
65
use gix_ref::file::ReferenceExt;
76

87
/// A platform to create iterators over references.
@@ -43,7 +42,6 @@ impl<'r> Platform<'r> {
4342
/// These are of the form `refs/heads` or `refs/remotes/origin`, and must not contain relative paths components like `.` or `..`.
4443
// TODO: Create a custom `Path` type that enforces the requirements of git naturally, this type is surprising possibly on windows
4544
// and when not using a trailing '/' to signal directories.
46-
#[momo]
4745
pub fn prefixed(&self, prefix: impl AsRef<Path>) -> Result<Iter<'_>, init::Error> {
4846
Ok(Iter::new(self.repo, self.platform.prefixed(prefix.as_ref())?))
4947
}

gix/src/remote/save.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use gix_macros::momo;
2-
31
use crate::{
42
bstr::{BStr, BString},
53
config, remote, Remote,
@@ -111,7 +109,6 @@ impl Remote<'_> {
111109
/// If this name is different from the current one, the git configuration will still contain the previous name,
112110
/// and the caller should account for that.
113111
#[allow(clippy::result_large_err)]
114-
#[momo]
115112
pub fn save_as_to(
116113
&mut self,
117114
name: impl Into<BString>,

gix/src/repository/config/transport.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#![allow(clippy::result_large_err)]
22
use std::any::Any;
33

4-
use gix_macros::momo;
5-
64
use crate::bstr::BStr;
75

86
impl crate::Repository {
@@ -23,7 +21,6 @@ impl crate::Repository {
2321
)),
2422
allow(unused_variables)
2523
)]
26-
#[momo]
2724
pub fn transport_options<'a>(
2825
&self,
2926
url: impl Into<&'a BStr>,

gix/src/repository/object.rs

-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
use std::ops::DerefMut;
33

44
use gix_hash::ObjectId;
5-
use gix_macros::momo;
65
use gix_object::{Exists, Find, FindExt};
76
use gix_odb::{Header, HeaderExt, Write};
87
use gix_ref::{
@@ -24,7 +23,6 @@ impl crate::Repository {
2423
///
2524
/// In order to get the kind of the object, is must be fully decoded from storage if it is packed with deltas.
2625
/// Loose object could be partially decoded, even though that's not implemented.
27-
#[momo]
2826
pub fn find_object(&self, id: impl Into<ObjectId>) -> Result<Object<'_>, object::find::existing::Error> {
2927
let id = id.into();
3028
if id == ObjectId::empty_tree(self.object_hash()) {
@@ -44,7 +42,6 @@ impl crate::Repository {
4442
///
4543
/// Note that despite being cheaper than [`Self::find_object()`], there is still some effort traversing delta-chains.
4644
#[doc(alias = "read_header", alias = "git2")]
47-
#[momo]
4845
pub fn find_header(&self, id: impl Into<ObjectId>) -> Result<gix_odb::find::Header, object::find::existing::Error> {
4946
let id = id.into();
5047
if id == ObjectId::empty_tree(self.object_hash()) {
@@ -65,7 +62,6 @@ impl crate::Repository {
6562
/// Use [`repo.objects.refresh_never()`](gix_odb::store::Handle::refresh_never) to avoid expensive
6663
/// IO-bound refreshes if an object wasn't found.
6764
#[doc(alias = "exists", alias = "git2")]
68-
#[momo]
6965
pub fn has_object(&self, id: impl AsRef<gix_hash::oid>) -> bool {
7066
let id = id.as_ref();
7167
if id == ObjectId::empty_tree(self.object_hash()) {
@@ -78,7 +74,6 @@ impl crate::Repository {
7874
/// Obtain information about an object without fully decoding it, or `None` if the object doesn't exist.
7975
///
8076
/// Note that despite being cheaper than [`Self::try_find_object()`], there is still some effort traversing delta-chains.
81-
#[momo]
8277
pub fn try_find_header(
8378
&self,
8479
id: impl Into<ObjectId>,
@@ -94,7 +89,6 @@ impl crate::Repository {
9489
}
9590

9691
/// Try to find the object with `id` or return `None` if it wasn't found.
97-
#[momo]
9892
pub fn try_find_object(&self, id: impl Into<ObjectId>) -> Result<Option<Object<'_>>, object::find::Error> {
9993
let id = id.into();
10094
if id == ObjectId::empty_tree(self.object_hash()) {
@@ -155,7 +149,6 @@ impl crate::Repository {
155149
///
156150
/// We avoid writing duplicate objects to slow disks that will eventually have to be garbage collected by
157151
/// pre-hashing the data, and checking if the object is already present.
158-
#[momo]
159152
pub fn write_blob(&self, bytes: impl AsRef<[u8]>) -> Result<Id<'_>, object::write::Error> {
160153
let bytes = bytes.as_ref();
161154
let oid = gix_object::compute_hash(self.object_hash(), gix_object::Kind::Blob, bytes);
@@ -201,7 +194,6 @@ impl crate::Repository {
201194
///
202195
/// It will be created with `constraint` which is most commonly to [only create it][PreviousValue::MustNotExist]
203196
/// or to [force overwriting a possibly existing tag](PreviousValue::Any).
204-
#[momo]
205197
pub fn tag(
206198
&self,
207199
name: impl AsRef<str>,

gix/src/repository/reference.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use gix_hash::ObjectId;
2-
use gix_macros::momo;
32
use gix_ref::{
43
transaction::{Change, LogChange, PreviousValue, RefEdit, RefLog},
54
FullName, PartialNameRef, Target,
@@ -13,7 +12,6 @@ impl crate::Repository {
1312
///
1413
/// It will be created with `constraint` which is most commonly to [only create it][PreviousValue::MustNotExist]
1514
/// or to [force overwriting a possibly existing tag](PreviousValue::Any).
16-
#[momo]
1715
pub fn tag_reference(
1816
&self,
1917
name: impl AsRef<str>,

gix/src/repository/revision.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
use gix_macros::momo;
2-
31
use crate::{bstr::BStr, revision, Id};
42

53
/// Methods for resolving revisions by spec or working with the commit graph.
@@ -11,7 +9,6 @@ impl crate::Repository {
119
/// - `@` actually stands for `HEAD`, whereas `git` resolves it to the object pointed to by `HEAD` without making the
1210
/// `HEAD` ref available for lookups.
1311
#[doc(alias = "revparse", alias = "git2")]
14-
#[momo]
1512
pub fn rev_parse<'a>(&self, spec: impl Into<&'a BStr>) -> Result<revision::Spec<'_>, revision::spec::parse::Error> {
1613
revision::Spec::from_bstr(
1714
spec,

gix/src/repository/worktree.rs

-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ impl crate::Repository {
5757
/// The entries will look exactly like they would if one would check them out, with filters applied.
5858
/// The `export-ignore` attribute is used to skip blobs or directories to which it applies.
5959
#[cfg(feature = "worktree-stream")]
60-
#[gix_macros::momo]
6160
pub fn worktree_stream(
6261
&self,
6362
id: impl Into<gix_hash::ObjectId>,

0 commit comments

Comments
 (0)