[composer] When searching snap targets, pick the closest one
Fix warning