pubfnformat_version(version:&str)-> String{letmut index =0;letmut dot_count =0;for(i, c)in version.chars().enumerate(){if c =='.'{
dot_count +=1;if dot_count ==2{
index = i;break;}}}// Extract the substring up to the second dot
version[..index].to_owned()}