Skip to content

Commit

Permalink
update crate-status to inform about tree-editing capabilities
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Sep 7, 2024
1 parent 5242aad commit ae27a5e
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 33 deletions.
52 changes: 26 additions & 26 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -390,3 +390,4 @@ unnecessary_join = "allow" # x1
stable_sort_primitive = "allow" # x1
no_effect_underscore_binding = "allow" # x1
empty_docs = "allow"
too_long_first_doc_paragraph = "allow"
2 changes: 2 additions & 0 deletions crate-status.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ The top-level crate that acts as hub to all functionality provided by the `gix-*
* [ ] create [signed commits and tags](https://github.com/Byron/gitoxide/issues/12)
* **trees**
* [x] lookup path
* [x] edit
* **references**
* [x] peel to end
* [x] ref-log access
Expand Down Expand Up @@ -213,6 +214,7 @@ The top-level crate that acts as hub to all functionality provided by the `gix-*
* [x] tag
* [x] [name validation][tagname-validation]
* [x] transform borrowed to owned objects
* [x] edit trees efficiently and write changes back
* [x] API documentation
* [ ] Some examples

Expand Down
9 changes: 6 additions & 3 deletions gix-config/src/file/access/read_only.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,10 @@ impl<'event> File<'event> {
/// # Ok::<(), Box<dyn std::error::Error>>(())
/// ```
#[must_use]
pub fn sections_by_name<'a>(&'a self, name: &'a str) -> Option<impl Iterator<Item = &file::Section<'event>> + '_> {
pub fn sections_by_name<'a>(
&'a self,
name: &'a str,
) -> Option<impl Iterator<Item = &'a file::Section<'event>> + 'a> {
self.section_ids_by_name(name).ok().map(move |ids| {
ids.map(move |id| {
self.sections
Expand All @@ -328,7 +331,7 @@ impl<'event> File<'event> {
pub fn sections_and_ids_by_name<'a>(
&'a self,
name: &'a str,
) -> Option<impl Iterator<Item = (&file::Section<'event>, SectionId)> + '_> {
) -> Option<impl Iterator<Item = (&'a file::Section<'event>, SectionId)> + 'a> {
self.section_ids_by_name(name).ok().map(move |ids| {
ids.map(move |id| {
(
Expand All @@ -347,7 +350,7 @@ impl<'event> File<'event> {
&'a self,
name: &'a str,
filter: &'a mut MetadataFilter,
) -> Option<impl Iterator<Item = &file::Section<'event>> + '_> {
) -> Option<impl Iterator<Item = &'a file::Section<'event>> + 'a> {
self.section_ids_by_name(name).ok().map(move |ids| {
ids.filter_map(move |id| {
let s = self
Expand Down
4 changes: 2 additions & 2 deletions gix-config/src/file/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ impl<'event> File<'event> {
&'a self,
section_name: &'a str,
subsection_name: Option<&BStr>,
) -> Result<impl ExactSizeIterator<Item = SectionId> + DoubleEndedIterator + '_, lookup::existing::Error> {
) -> Result<impl ExactSizeIterator<Item = SectionId> + DoubleEndedIterator + 'a, lookup::existing::Error> {
let section_name = section::Name::from_str_unchecked(section_name);
let section_ids = self
.section_lookup_tree
Expand Down Expand Up @@ -146,7 +146,7 @@ impl<'event> File<'event> {
pub(crate) fn section_ids_by_name<'a>(
&'a self,
section_name: &'a str,
) -> Result<impl Iterator<Item = SectionId> + '_, lookup::existing::Error> {
) -> Result<impl Iterator<Item = SectionId> + 'a, lookup::existing::Error> {
let section_name = section::Name::from_str_unchecked(section_name);
match self.section_lookup_tree.get(&section_name) {
Some(lookup) => {
Expand Down
2 changes: 1 addition & 1 deletion gix-index/src/access/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ impl State {
directory: &BStr,
ignore_case: bool,
lookup: &AccelerateLookup<'a>,
) -> Option<&Entry> {
) -> Option<&'a Entry> {
lookup
.icase_dirs
.find(AccelerateLookup::icase_hash(directory), |dir| {
Expand Down
2 changes: 1 addition & 1 deletion gix-submodule/src/access.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ impl File {
) -> bool
+ 'a),
) -> Result<
impl Iterator<Item = (&BStr, Result<bool, gix_config::value::Error>)> + 'a,
impl Iterator<Item = (&'a BStr, Result<bool, gix_config::value::Error>)> + 'a,
crate::is_active_platform::Error,
> {
let mut platform = self.is_active_platform(config, defaults)?;
Expand Down
1 change: 1 addition & 0 deletions gix/src/worktree/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pub type Index = gix_fs::SharedFileSnapshot<gix_index::File>;

/// A type to represent an index which either was loaded from disk as it was persisted there, or created on the fly in memory.
#[cfg(feature = "index")]
#[allow(clippy::large_enum_variant)]
pub enum IndexPersistedOrInMemory {
/// The index as loaded from disk, and shared across clones of the owning `Repository`.
Persisted(Index),
Expand Down

0 comments on commit ae27a5e

Please sign in to comment.