Uhhh. Das erste Mal Kontakt mit dem ownership Konzept in #Rust gehabt ...

... Wird es jetzt erst mit der Lernkurve?
#learningRust

@tze #learningRust can really be fun.

Ich diskutiere gerne Rust-Code mit ChatGPT. Die KI ist wirklich gut darin, einem auf Nachfrage ausführlich die Feinheiten und Hintergründe zu erklären.

Hab ne programmier Aufgabe in #rust bearbeitet ...

... alle Tests sind bestanden ...

... der Code funktioniert ...

... aber WARUM zum henker?
#learningRust

Thanks to the bank holiday (in Germany) I had some time to finish the third part of my **Learning Rust** post series!

This part is all about structs, tuples and (crazy) enums!

And of course some MIRs again, what else?

https://lukasrotermund.de/posts/structs-enums-and-pattern-matching-in-rust/

#rust #rustlang #learningrust #therustprogramminglanguage

Structs, Enums and Pattern Matching in Rust

In this part of the Learning Rust series I read about structs, enums, and pattern matching. I really looked forward to this chapter because I loved how Rust implements enums when working with Rustlings.

Lukas Rotermund

Thanks to the bank holiday (in Germany) I had some time to finish the third part of my **Learning Rust** post series!

This part is all about structs, tuples and (crazy) enums!

And of course some MIRs again, what else?

https://lukasrotermund.de/posts/structs-enums-and-pattern-matching-in-rust/

#Rust #rustlang #LearningRust #TheRustProgrammingLanguage

Structs, Enums and Pattern Matching in Rust

In this part of the Learning Rust series I read about structs, enums, and pattern matching. I really looked forward to this chapter because I loved how Rust implements enums when working with Rustlings.

Lukas Rotermund

Ich schaue mir gerade #Rust an, die Syntax fühlt sich wirklich ungewohnt an. Gerade Ownership, Borrowing & Lifetimes brauchen ein bisschen, bis sie „klicken“. Aber: Die Dokumentation ist hervorragend strukturiert und erklärt viele Konzepte erstaunlich klar.

Finde #rustlings total toll – kleine, praktische Übungen direkt im Terminal, bei denen man Schritt für Schritt typische Rust-Probleme löst. Sehr hands-on und perfekt, um ein Gefühl für die Sprache zu entwickeln.

#Programming #LearningRust

Please share your opinions on my learning code parquet2csv

I hope it’s ok to ask for some feedback here. Of not, please let me know. The rules did not sound like against it

I’m very new to Rust. And while in general my coding background is ok, Rust still feels alien to me. I think I’m just still at “how to think in Rust” part of the curve.

So I would like to ask here for opinions on the following bit of code. I know that those unwrap are too optimistic for production, and I could figure out how to pass io::Error from the function all the way up to the shell. But what are other choices that I don’t see?
What would you write differently? What looks like Pythonisms/C++isms? Or is missing the mark completely?

use std::{fs, io}; use std::path::PathBuf; use std::convert::TryFrom; use clap::Parser; use parquet::file::reader::SerializedFileReader; use parquet::record; use csv::WriterBuilder; #[derive(Debug, Parser)] #[command(version, about, long_about = None)] struct Args { dir: String, #[arg(default_value = "0")] count: usize } fn get_files_in_dir(dir: &str) -> Option<Vec<PathBuf>> { let dir = fs::read_dir(dir); if dir.is_err() { return None }; let files = dir.unwrap() .map(|res| res.map(|e| e.path())) .collect::<Result<Vec<_>, _>>(); if files.is_err() { return None } files.ok() } fn read_parquet_dir(entries: &Vec<String>) -> impl Iterator<Item = record::Row> { entries.iter() .map(|p| SerializedFileReader::try_from(p.clone()).unwrap()) .flat_map(|r| r.into_iter()) .map(|r| r.unwrap()) } fn main() -> Result<(), io::Error> { let args = Args::parse(); let entries = match get_files_in_dir(&args.dir) { Some(entries) => entries, None => return Ok(()) }; let mut wtr = WriterBuilder::new().from_writer(io::stdout()); for (idx, row) in read_parquet_dir(&entries.iter().map(|p| p.display().to_string()).collect()).enumerate() { let values: Vec<String> = row.get_column_iter().map(|(_column, value)| value.to_string()).collect(); if idx == 0 { wtr.serialize(row.get_column_iter().map(|(column, _value)| column.to_string()).collect::<Vec<String>>())?; } wtr.serialize(values)?; if args.count>0 && idx+1 == args.count { break; } } Ok(()) }
Ah, yet another aspiring "author" 📝 thinks the world needs a #book about #Ruby that it never asked for. But don't worry, it'll be ready sometime before the heat death of the universe. 🚀 Why bother with actual #innovation when you can just repackage the same boring tech jargon with a sprinkle of "I'm learning Rust"? 🙄
https://patshaughnessy.net/2025/11/17/compiling-ruby-to-machine-language #Overload #TechJargon #LearningRust #AspiringAuthors #HackerNews #ngated
Compiling Ruby To Machine Language - Pat Shaughnessy

#rust ggez app i'm writing crashes when I'm on my laptop, but works when I use it with the docking station (which I don't have with me on the train to Nürnberg). Some unresolved wgpu bug: https://github.com/gfx-rs/wgpu/issues/6159

Time to work on something else, I guess...
#learningRust #programming

Panic at unreachable · Issue #6159 · gfx-rs/wgpu

Description Panic at an unreachable in wgpu-core/src/device/global.rs, line 1859: unreachable!("Fallback system failed to choose present mode. This is a bug. Mode: {:?}, Options: {:?}", config.pres...

GitHub

Just wrapped up another Rust project—Minigrep, a command-line file search tool! Feeling accomplished and excited for the next challenge!

😇 If you’re learning Rust, I highly recommend tackling this—it’s a great way to level up!

#RustLang #Coding #SystemsProgramming #LearningRust #Minigrep #DevJourney