Subj : Re: Rust >.< To : apam From : tenser Date : Fri Oct 07 2022 01:26:09 On 06 Oct 2022 at 10:32a, apam pondered and said... ap> > I can't reproduce this locally, though. Copy/pasting ap> > into `syncterm` is hard for reasons, but ap> ap> I finally figured it out this morning, my string had some of the IAC ap> commands in it. Strangly, printing it to the console printed like this: ap> ap> String: "new" ap> Length: 5 ap> ap> then I tried iterating through the string as bytes and saw: ap> ap> 1 ap> 3 ap> 110 ap> 101 ap> 119 That'll do it. :-) I'm not surprised that printing this doesn't show the 1 and 3; those are ASCII control characters in this context, "start-of-heading" and "end-of-text" and they're probably absorbed by the terminal. Piping the output through something like `cat -v` can be illuminating in these cases. ap> So, my error is in my read string function, and not in the file accessing ap> at all. Thanks for the tips though! assert helped. I'm sure this code is ap> horrible, a lot of it is me trying different things to get it to ap> compile... Everyone fights the borrow checker for a little while, but then afterwards, it starts to make sense. I've been programming full-time in Rust for something like four years now, and I came to it really skeptical, but it's grown on me. ap> I think I mentioned? I ordered a book on rust from amazon, should ap> hopefully get here next week, in the meantime... :) Hopefully will ap> organise my code better after working through that, at present it's a bit ap> of a mess. The O'Reilly book and the one from No Starch are excellent; the No Starch one is the "official" book and is available online for free! https://doc.rust-lang.org/book/ is the exact same text as the dead-trees version. --- Mystic BBS v1.12 A47 2021/12/24 (Linux/64) * Origin: Agency BBS | Dunedin, New Zealand | agency.bbs.nz (21:1/101) .