How to convert ContractId to AssetId in the rust SDK

Is there another way to convert ContractId to AssetId in the rust SDK?
AssetId::from_str(uni.contract_id.to_string().as_str()).unwrap()