@@ -94,7 +94,7 @@ impl<'repo> Blame<'repo> {
9494}
9595
9696impl < ' blame > BlameHunk < ' blame > {
97- unsafe fn from_raw_const ( raw : * const raw:: git_blame_hunk ) -> BlameHunk < ' blame > {
97+ unsafe fn from_raw_const ( raw : * const raw:: git_blame_hunk ) -> Self {
9898 BlameHunk {
9999 raw : raw as * mut raw:: git_blame_hunk ,
100100 _marker : marker:: PhantomData ,
@@ -160,7 +160,7 @@ impl<'blame> BlameHunk<'blame> {
160160
161161 /// Returns number of lines in this hunk.
162162 pub fn lines_in_hunk ( & self ) -> usize {
163- unsafe { ( * self . raw ) . lines_in_hunk as usize }
163+ unsafe { ( * self . raw ) . lines_in_hunk }
164164 }
165165}
166166
@@ -172,7 +172,7 @@ impl Default for BlameOptions {
172172
173173impl BlameOptions {
174174 /// Initialize options
175- pub fn new ( ) -> BlameOptions {
175+ pub fn new ( ) -> Self {
176176 unsafe {
177177 let mut raw: raw:: git_blame_options = mem:: zeroed ( ) ;
178178 assert_eq ! (
@@ -184,7 +184,7 @@ impl BlameOptions {
184184 }
185185 }
186186
187- fn flag ( & mut self , opt : u32 , val : bool ) -> & mut BlameOptions {
187+ fn flag ( & mut self , opt : u32 , val : bool ) -> & mut Self {
188188 if val {
189189 self . raw . flags |= opt;
190190 } else {
@@ -194,69 +194,69 @@ impl BlameOptions {
194194 }
195195
196196 /// Track lines that have moved within a file.
197- pub fn track_copies_same_file ( & mut self , opt : bool ) -> & mut BlameOptions {
197+ pub fn track_copies_same_file ( & mut self , opt : bool ) -> & mut Self {
198198 self . flag ( raw:: GIT_BLAME_TRACK_COPIES_SAME_FILE , opt)
199199 }
200200
201201 /// Track lines that have moved across files in the same commit.
202- pub fn track_copies_same_commit_moves ( & mut self , opt : bool ) -> & mut BlameOptions {
202+ pub fn track_copies_same_commit_moves ( & mut self , opt : bool ) -> & mut Self {
203203 self . flag ( raw:: GIT_BLAME_TRACK_COPIES_SAME_COMMIT_MOVES , opt)
204204 }
205205
206206 /// Track lines that have been copied from another file that exists
207207 /// in the same commit.
208- pub fn track_copies_same_commit_copies ( & mut self , opt : bool ) -> & mut BlameOptions {
208+ pub fn track_copies_same_commit_copies ( & mut self , opt : bool ) -> & mut Self {
209209 self . flag ( raw:: GIT_BLAME_TRACK_COPIES_SAME_COMMIT_COPIES , opt)
210210 }
211211
212212 /// Track lines that have been copied from another file that exists
213213 /// in any commit.
214- pub fn track_copies_any_commit_copies ( & mut self , opt : bool ) -> & mut BlameOptions {
214+ pub fn track_copies_any_commit_copies ( & mut self , opt : bool ) -> & mut Self {
215215 self . flag ( raw:: GIT_BLAME_TRACK_COPIES_ANY_COMMIT_COPIES , opt)
216216 }
217217
218218 /// Restrict the search of commits to those reachable following only
219219 /// the first parents.
220- pub fn first_parent ( & mut self , opt : bool ) -> & mut BlameOptions {
220+ pub fn first_parent ( & mut self , opt : bool ) -> & mut Self {
221221 self . flag ( raw:: GIT_BLAME_FIRST_PARENT , opt)
222222 }
223223
224224 /// Use mailmap file to map author and committer names and email addresses
225225 /// to canonical real names and email addresses. The mailmap will be read
226226 /// from the working directory, or HEAD in a bare repository.
227- pub fn use_mailmap ( & mut self , opt : bool ) -> & mut BlameOptions {
227+ pub fn use_mailmap ( & mut self , opt : bool ) -> & mut Self {
228228 self . flag ( raw:: GIT_BLAME_USE_MAILMAP , opt)
229229 }
230230
231231 /// Ignore whitespace differences.
232- pub fn ignore_whitespace ( & mut self , opt : bool ) -> & mut BlameOptions {
232+ pub fn ignore_whitespace ( & mut self , opt : bool ) -> & mut Self {
233233 self . flag ( raw:: GIT_BLAME_IGNORE_WHITESPACE , opt)
234234 }
235235
236236 /// Setter for the id of the newest commit to consider.
237- pub fn newest_commit ( & mut self , id : Oid ) -> & mut BlameOptions {
237+ pub fn newest_commit ( & mut self , id : Oid ) -> & mut Self {
238238 unsafe {
239239 self . raw . newest_commit = * id. raw ( ) ;
240240 }
241241 self
242242 }
243243
244244 /// Setter for the id of the oldest commit to consider.
245- pub fn oldest_commit ( & mut self , id : Oid ) -> & mut BlameOptions {
245+ pub fn oldest_commit ( & mut self , id : Oid ) -> & mut Self {
246246 unsafe {
247247 self . raw . oldest_commit = * id. raw ( ) ;
248248 }
249249 self
250250 }
251251
252252 /// The first line in the file to blame.
253- pub fn min_line ( & mut self , lineno : usize ) -> & mut BlameOptions {
253+ pub fn min_line ( & mut self , lineno : usize ) -> & mut Self {
254254 self . raw . min_line = lineno;
255255 self
256256 }
257257
258258 /// The last line in the file to blame.
259- pub fn max_line ( & mut self , lineno : usize ) -> & mut BlameOptions {
259+ pub fn max_line ( & mut self , lineno : usize ) -> & mut Self {
260260 self . raw . max_line = lineno;
261261 self
262262 }
@@ -265,7 +265,7 @@ impl BlameOptions {
265265impl < ' repo > Binding for Blame < ' repo > {
266266 type Raw = * mut raw:: git_blame ;
267267
268- unsafe fn from_raw ( raw : * mut raw:: git_blame ) -> Blame < ' repo > {
268+ unsafe fn from_raw ( raw : * mut raw:: git_blame ) -> Self {
269269 Blame {
270270 raw,
271271 _marker : marker:: PhantomData ,
@@ -286,7 +286,7 @@ impl<'repo> Drop for Blame<'repo> {
286286impl < ' blame > Binding for BlameHunk < ' blame > {
287287 type Raw = * mut raw:: git_blame_hunk ;
288288
289- unsafe fn from_raw ( raw : * mut raw:: git_blame_hunk ) -> BlameHunk < ' blame > {
289+ unsafe fn from_raw ( raw : * mut raw:: git_blame_hunk ) -> Self {
290290 BlameHunk {
291291 raw,
292292 _marker : marker:: PhantomData ,
@@ -301,8 +301,8 @@ impl<'blame> Binding for BlameHunk<'blame> {
301301impl Binding for BlameOptions {
302302 type Raw = * mut raw:: git_blame_options ;
303303
304- unsafe fn from_raw ( opts : * mut raw:: git_blame_options ) -> BlameOptions {
305- BlameOptions { raw : * opts }
304+ unsafe fn from_raw ( opts : * mut raw:: git_blame_options ) -> Self {
305+ Self { raw : * opts }
306306 }
307307
308308 fn raw ( & self ) -> * mut raw:: git_blame_options {
0 commit comments