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