Skip to content

Commit

Permalink
Use .as_refs() in gix-config to avoid unnecessary monomorphization.
Browse files Browse the repository at this point in the history
  • Loading branch information
bittrance committed Mar 2, 2024
1 parent b3556b2 commit 819d7eb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions gix-config/src/file/access/comfort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ impl<'event> File<'event> {
subsection_name: Option<&BStr>,
key: impl AsRef<str>,
) -> Option<Cow<'_, BStr>> {
self.string_filter_by(section_name, subsection_name, key, &mut |_| true)
self.string_filter_by(section_name.as_ref(), subsection_name, key.as_ref(), &mut |_| true)
}

/// Like [`string()`][File::string_by()], but suitable for statically known `key`s like `remote.origin.url`.
Expand Down Expand Up @@ -53,7 +53,7 @@ impl<'event> File<'event> {
subsection_name: Option<&BStr>,
key: impl AsRef<str>,
) -> Option<crate::Path<'_>> {
self.path_filter_by(section_name, subsection_name, key, &mut |_| true)
self.path_filter_by(section_name.as_ref(), subsection_name, key.as_ref(), &mut |_| true)
}

/// Like [`path()`][File::path_by()], but suitable for statically known `key`s like `remote.origin.url`.
Expand Down Expand Up @@ -91,7 +91,7 @@ impl<'event> File<'event> {
subsection_name: Option<&BStr>,
key: impl AsRef<str>,
) -> Option<Result<bool, value::Error>> {
self.boolean_filter_by(section_name, subsection_name, key, &mut |_| true)
self.boolean_filter_by(section_name.as_ref(), subsection_name, key.as_ref(), &mut |_| true)
}

/// Like [`boolean()`][File::boolean_by()], but suitable for statically known `key`s like `remote.origin.url`.
Expand Down Expand Up @@ -209,7 +209,7 @@ impl<'event> File<'event> {
subsection_name: Option<&BStr>,
key: impl AsRef<str>,
) -> Option<Result<Vec<i64>, value::Error>> {
self.integers_filter_by(section_name, subsection_name, key, &mut |_| true)
self.integers_filter_by(section_name.as_ref(), subsection_name, key.as_ref(), &mut |_| true)
}

/// Like [`integers()`][File::integers_by()], but suitable for statically known `key`s like `remote.origin.url`.
Expand Down

0 comments on commit 819d7eb

Please sign in to comment.