File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -273,7 +273,7 @@ impl Release {
273
273
let Some ( mut readme) = readme_file. get ( ) ? else {
274
274
bail ! ( "README.md suddenly disappeared!" ) ;
275
275
} ;
276
- if readme. ensure_changelog_link ( & ghrepo, & default_branch) {
276
+ if readme. ensure_changelog_link ( & ghrepo, default_branch) {
277
277
log:: info!( "Adding Changelog link to README.md ..." ) ;
278
278
readme_file. set ( readme) ?;
279
279
}
Original file line number Diff line number Diff line change @@ -138,13 +138,13 @@ impl<'a> Git<'a> {
138
138
}
139
139
140
140
// Returns None if the default branch could not be determined
141
- pub ( crate ) fn default_branch ( & self ) -> Result < Option < String > , CommandOutputError > {
141
+ pub ( crate ) fn default_branch ( & self ) -> Result < Option < & ' static str > , CommandOutputError > {
142
142
let branches = self
143
143
. readlines ( "branch" , [ "--format=%(refname:short)" ] ) ?
144
144
. collect :: < HashSet < _ > > ( ) ;
145
145
for guess in [ "main" , "master" ] {
146
146
if branches. contains ( guess) {
147
- return Ok ( Some ( guess. to_owned ( ) ) ) ;
147
+ return Ok ( Some ( guess) ) ;
148
148
}
149
149
}
150
150
Ok ( None )
You can’t perform that action at this time.
0 commit comments