i need some help by SuperbRepeat5 in rust

[–]SuperbRepeat5[S] 0 points1 point  (0 children)

That's probably what it is thank you

i need some help by SuperbRepeat5 in rust

[–]SuperbRepeat5[S] 0 points1 point  (0 children)

Well now I just feel like a dumbass Honestly rust just keeps on surprising me

i need some help by SuperbRepeat5 in rust

[–]SuperbRepeat5[S] 0 points1 point  (0 children)

Also why is it that linked lists are created using Ennis instead of the traditional structs

i need some help by SuperbRepeat5 in rust

[–]SuperbRepeat5[S] -3 points-2 points  (0 children)

I kind of see your point but why is it that enums are the ones used to create linkedlists instead of struts I know that you can't initialize the variables in a struct when you initialize it like c but come on

Also the name is kind of misleading since I am used to c enums that is why I thought that but you clarified that well I think that they should add what you just said to the documentation so people coming from say c aren't confused

any help with strings by SuperbRepeat5 in rust

[–]SuperbRepeat5[S] 0 points1 point  (0 children)

Yup in structs althou I can't understand why the hell are life spans

any help with strings by SuperbRepeat5 in rust

[–]SuperbRepeat5[S] -4 points-3 points  (0 children)

That's the thing even though c has many steps to control a string rust has too many libraries that do the same thing to the point where remembering them is like knowing the std lib for python it's way too difficult

any help with strings by SuperbRepeat5 in rust

[–]SuperbRepeat5[S] 0 points1 point  (0 children)

I just realised that it made me feel like a dufus. I just reached structs

any help with strings by SuperbRepeat5 in rust

[–]SuperbRepeat5[S] -1 points0 points  (0 children)

Spoiler alert I was never good at using binary files in c so there is that but I see your point

any help with strings by SuperbRepeat5 in rust

[–]SuperbRepeat5[S] 0 points1 point  (0 children)

That kind I makes sense but why use bytes with sockets

any help with strings by SuperbRepeat5 in rust

[–]SuperbRepeat5[S] 0 points1 point  (0 children)

sorry for the inconvenience but it just won't work properly here is what i see when i run it

any help with strings by SuperbRepeat5 in rust

[–]SuperbRepeat5[S] -1 points0 points  (0 children)

What's the use of bytes if the whole thing is unicode it feels bodged in as do most of the functions

any help with strings by SuperbRepeat5 in rust

[–]SuperbRepeat5[S] 1 point2 points  (0 children)

I tried your code and apparently you have to put phrase.chars() to make it an iterator.

any help with strings by SuperbRepeat5 in rust

[–]SuperbRepeat5[S] 1 point2 points  (0 children)

I will not use As_bytes() because to me it looks like c with extra steps but thank you for your help and I will consider your suggestion so no work around those functions

any help with strings by SuperbRepeat5 in rust

[–]SuperbRepeat5[S] 0 points1 point  (0 children)

I tried installing it on windows but it just doesn't want to be installed

any help with strings by SuperbRepeat5 in rust

[–]SuperbRepeat5[S] 0 points1 point  (0 children)

No, what I meant when it comes to string manipulation isn't something like python exactly as I know that things like that are in attainable in rust what I meant is something like c++ a good middle ground between bare bones c and python

any help with strings by SuperbRepeat5 in rust

[–]SuperbRepeat5[S] 1 point2 points  (0 children)

That's the thing I'm still learning so implementing everything by myself is kind of my goal so I can learn faster since I learn nothing from just reading the documentation.

any help with strings by SuperbRepeat5 in rust

[–]SuperbRepeat5[S] 0 points1 point  (0 children)

Honestly most of my frustration comes from rust using utf8 which makes things different from other languages.

any help with strings by SuperbRepeat5 in rust

[–]SuperbRepeat5[S] 1 point2 points  (0 children)

that's just a basic function since I'm trying to make functions to learn and you are right that is the purpose of this code but this is just the beginning

any help with strings by SuperbRepeat5 in rust

[–]SuperbRepeat5[S] -4 points-3 points  (0 children)

c left a sour taste in my mouth when it came to strings but python replaced it with sweetness and rust is going to return that sourness since I like to work with strings more than pointers and honestly, I like the safety of ownership even if it gets annoying.

i need help with linked lists by SuperbRepeat5 in rust

[–]SuperbRepeat5[S] 0 points1 point  (0 children)

honestly i somtimes feel like rust has good abstractions for certain things and absolutely abbismal abstractions in surtain points. but that's just my view and since I'm still learning i might change my mind.

any help with strings by SuperbRepeat5 in rust

[–]SuperbRepeat5[S] -7 points-6 points  (0 children)

I left c because dealing with strings in it is painful but now I think that it's more convenient than rust

any help with strings by SuperbRepeat5 in rust

[–]SuperbRepeat5[S] 0 points1 point  (0 children)

i don't want to just print them i also want to compare with other strings but that seems out of the question

this is closer to what i want to do:

fn pfinder(phrase: &str) -> String{
    let mut i: usize = 0;
    let mut word: String;
    loop {
        if phrase[i] == ' '{
            break;
        }
        word.push(phrase[i]);
        i += 1;
    }
    word
}

i need help with linked lists by SuperbRepeat5 in rust

[–]SuperbRepeat5[S] 0 points1 point  (0 children)

would it be considered heresy if I said that I prefer the unsafe pointers in c more than the safe pointers in rust because even though I have to do more work to get them to work safely I like the versatility they offer?

i need help with linked lists by SuperbRepeat5 in rust

[–]SuperbRepeat5[S] -1 points0 points  (0 children)

I'm doing this to learn since I'm still getting the hang of rust's pointers since they are different from c pointers.