Rust solution
rust\nimpl Solution {\n    pub fn smallest_repunit_div_by_k(k: i32) -> i32 {\n        let mut m = 0;\n        for i in 1..=k {\n            m = (m * 10 + 1) % k
```rust\nimpl Solution {\n    pub fn smallest_repunit_div_by_k(k: i32) -> i32 {\n        let mut m = 0;\n        for i in 1..=k {\n            m = (m * 10 + 1) % k;\n            if m == 0 {\n                return i;\n            }\n        }\n        -1\n    }\n}\n```
['Rust']