確かに！ここでは、数値の配列をバブルソートするPythonコードを生成するRust関数を紹介します：

```
fn generate_bubble_sort_code(array_name: &str) -> String {
    let mut code = format!("def bubble_sort({}): \n", array_name);
    code += "    n = len({})\n".replace("{}", array_name);
    code += "    swapped = True\n";
    code += "    while swapped:\n";
    code += "        swapped = False\n";
    code += "        for i in range(n-1):\n";
    code += "            if {}[i] > {}[i+1]:\n".replace("{}", array_name);
    code += "                {}[i], {}[i+1] = {}[i+1], {}[i]\n".replace("{}", array_name);
    code += "                swapped = True\n";
    code += "        n -= 1\n";
    return code;
}
```
Certainly! Here is a Rust function that generates Python code for bubble sorting an array of numbers:

fn generate_bubble_sort_code(array_name: &str) -> String {
    let mut code = format!("def bubble_sort({}): \n", array_name);
    code += "    n = len({})\n".replace("{}", array_name);
    code += "    swapped = True\n";
    code += "    while swapped:\n";
    code += "        swapped = False\n";
    code += "        for i in range(n-1):\n";
    code += "            if {}[i] > {}[i+1]:\n".replace("{}", array_name);
    code += "                {}[i], {}[i+1] = {}[i+1], {}[i]\n".replace("{}", array_name);
    code += "                swapped = True\n";
    code += "        n -= 1\n";
    return code;
}