Python to Rust Code Convert

Hello, I tried to convert this python code to rust:

validfile = open('validated.txt', 'r')
    validinfo = validfile.read()
    validinfo = validinfo.split('\n')
    session = sessions.FuturesSession(max_workers=thread)
    refresh = []
    futures = []
    start_snipe = time.time()
for i in range(thread):
        alt_index = random.randint(0, len(validinfo) - 1)
        futures.append(session.post(f"https://api.mojang.com/user/profile/{validinfo[alt_index].rpartition(':')[(-1)].rpartition(':')[(-1)]}/name", headers={'Authorization': 'Bearer ' + validinfo[alt_index].rpartition(':')[0].rpartition(':')[(-1)]}, json={'name':TARGET,  'password':validinfo[alt_index].rpartition(':')[0].rpartition(':')[0].rpartition(':')[-1]}))

Tried for like 30 minutes, but I have no idea how it should look in Rust. Can anyone help me? I need it very clean code, simple and complex. How should I'll do it in the best way and next time I will know. Also some examples will help. Also, validated.txt it's spaced. Like email@email.com:password:bearer

It would help if you posted what you've tried so it can be helped. I doubt someone is going to come along and convert code for you for free.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.