File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -77,15 +77,25 @@ impl<'a> Commit<'a> {
77
77
}
78
78
}
79
79
80
- pub fn id ( & self ) -> borrowed:: Id < ' _ > {
80
+ // Allow the return value to outlive this Commit object, as it only needs to be bound by the
81
+ // lifetime of the parent file.
82
+ pub fn id < ' b > ( & ' b self ) -> borrowed:: Id < ' a >
83
+ where
84
+ ' a : ' b ,
85
+ {
81
86
self . file . id_at ( self . pos )
82
87
}
83
88
84
89
pub fn parent1 ( & self ) -> Result < Option < graph:: Position > , Error > {
85
90
self . iter_parents ( ) . next ( ) . transpose ( )
86
91
}
87
92
88
- pub fn root_tree_id ( & self ) -> borrowed:: Id < ' _ > {
93
+ // Allow the return value to outlive this Commit object, as it only needs to be bound by the
94
+ // lifetime of the parent file.
95
+ pub fn root_tree_id < ' b > ( & ' b self ) -> borrowed:: Id < ' a >
96
+ where
97
+ ' a : ' b ,
98
+ {
89
99
self . root_tree_id
90
100
}
91
101
}
You can’t perform that action at this time.
0 commit comments