So this is the power of Rust

So this is the power of Rust

Attached: c_to_rust.png (1471x554, 67.35K)

>comparing generated code to handwritten code
what did you expect, retard? wait till you see what disassembled code looks like

More code means more work done!!1!!!111!11!!!!!111

This is the power of online sites, you can get this to look tidier and less messy when you write it from the ground up with actual knowledge of the Rust language.
This is a pretty cheap and low attack to do when you could legitimately Rust in a thousand more valid ways.

Attached: vomit.png (500x484, 217.48K)

>allow non_snake_case
Do Rust trannies really

wow, code gen is bad! Colour me surprised!

pub fn insertion_sort(arr: &mut [i32]) {
for i in 1..arr.len() {
let mut j = i;
while j > 0 && arr[j - 1] > arr[j] {
arr.swap(j - 1, j);
j -= 1;
}
}
}

Still uglier than C

Lets just end the conversation now
C and Linux were always designed with the idea that everything ends in a file
Once you actually understand what that means c becomes the easiest language on earth
Rust is some bullshit windows way of doing things

>Colour

Attached: 1500151717207.jpg (276x183, 5.22K)

pub fn pd_qsort(arr: &mut [i32]) {
arr.sort_unstable();
}

You write an essay and proof read it once the content and structure is there.
I don't want a complier yelling at me i forget to capitalise a constant or some shit.

C to Go lol
package main

import "unsafe"

func insertion_sort(n int32, p *int32) {
{
var i int32 = int32(1)
for ; i < n; i++ {
var tmp int32 = *((*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(p)) + (uintptr)(i)*unsafe.Sizeof(*p))))
var j int32 = i
for j > int32(0) && *((*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(p)) + (uintptr)(j-int32(1))*unsafe.Sizeof(*p)))) > tmp {
*((*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(p)) + (uintptr)(j)*unsafe.Sizeof(*p)))) = *((*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(p)) + (uintptr)(j-int32(1))*unsafe.Sizeof(*p))))
j -= 1
}
*((*int32)(unsafe.Pointer(uintptr(unsafe.Pointer(p)) + (uintptr)(j)*unsafe.Sizeof(*p)))) = tmp
}
}
}

So this is the power of rust

Attached: rust.jpg (720x720, 241.96K)

Attached: splitstr_rust.png (1828x904, 135.92K)

So much unsafe

Attached: b32.jpg (600x492, 77.74K)

To make Rust trannies seethe

>c2rust
not sure if OP is a dumb nigger or just trolling. Jannies, clean it up.

fn split_str(text: &str, delim: char) -> Vec {
let count = text.chars().filter(|&c| c == delim).count();
let mut out = Vec::with_capacity(count);
let mut rest = text;
while let Some(index) = rest.find(delim) {
out.push(&rest[..index]);
rest = &rest[index + delim.len_utf8()..];
}
out.push(rest);
out
}
Reasonable UTF-8 handling and only a single allocation
I could do it in zero allocations if I wrote an iterator (or you could just use str::split())

That's how a nigger would do it, here is how it should be
func insertionSort(arr []int) {
len := len(arr)
for i := 1; i < len; i++ {
for j := 0; j < i; j++ {
if arr[j] > arr[i] {
arr[j], arr[i] = arr[i], arr[j]
}
}
}
}


If you import unsafe in Go you should probably just write your code in C

rent free

looks about the same in terms of beauty to me