@@ -278,14 +278,14 @@ fn get_ppm_linux_repo(repo_url: Option<url::Url>, linux_name: String) -> anyhow:
278278fn get_p3m_linux_codename ( id : String , version : String , version_codename : String ) -> String {
279279 // For Debian and Ubuntu, we can just use the codename
280280 if id == "debian" || id == "ubuntu" || id == "pop" {
281- return version_codename. to_string ( ) ;
281+ version_codename. to_string ( )
282282 } else if id == "rhel" {
283283 // For RHEL, we use the id and major version number
284284 let parts: Vec < & str > = version. split ( '.' ) . collect ( ) ;
285285 if parts. len ( ) > 1 {
286- return format ! ( "{}{}" , id, parts[ 0 ] ) ;
286+ format ! ( "{}{}" , id, parts[ 0 ] )
287287 } else {
288- return format ! ( "{}{}" , id, version) ;
288+ format ! ( "{}{}" , id, version)
289289 }
290290 } else if id == "sles" || id. starts_with ( "opensuse" ) {
291291 // For sles and opensuse we use the id and major and minor version number
@@ -294,12 +294,12 @@ fn get_p3m_linux_codename(id: String, version: String, version_codename: String)
294294
295295 let parts: Vec < & str > = version. split ( '.' ) . collect ( ) ;
296296 if parts. len ( ) > 1 {
297- return format ! ( "{}{}{}" , distro_id, parts[ 0 ] , parts[ 1 ] ) ;
297+ format ! ( "{}{}{}" , distro_id, parts[ 0 ] , parts[ 1 ] )
298298 } else {
299- return format ! ( "{}{}" , distro_id, version) ;
299+ format ! ( "{}{}" , distro_id, version)
300300 }
301301 } else {
302- return String :: new ( ) ;
302+ String :: new ( )
303303 }
304304}
305305
@@ -322,7 +322,7 @@ fn get_ppm_binary_package_repo(repo_url: Option<url::Url>) -> String {
322322 if let Ok ( file) = File :: open ( "/etc/os-release" ) {
323323 let reader = BufReader :: new ( file) ;
324324
325- for line in reader. lines ( ) . flatten ( ) {
325+ for line in reader. lines ( ) . map_while ( Result :: ok ) {
326326 if version_codename. is_empty ( ) && line. starts_with ( version_codename_key) {
327327 version_codename = line[ version_codename_key. len ( ) ..] . to_string ( ) ;
328328 } else if id. is_empty ( ) && line. starts_with ( id_key) {
0 commit comments