Its certainly an odd situation π
I have a related data coming from multiple sources and I need to flat map over a couple of different dimensions. I had an initial solution that initialised with a default like you're suggesting but then I wanted to see if there was a succinct solution I was missing.
               
            
            
                23.10.2025 14:11 β π 0    π 0    π¬ 1    π 0                      
            
         
            
        
            
            
            
            
            
    
    
    
    
            Has anyone else needed to do this sort of thing before? Is there a better way to do this?
```
let mut it = my_vec.clone().into_iter();
let it = std::iter::once(
    it.next().unwrap_or_default()
)
.chain(it);
```
#rust #rustlang
               
            
            
                23.10.2025 12:39 β π 0    π 0    π¬ 1    π 0                      
            
         
            
        
            
            
            
            
            
    
    
    
    
            Yesterday I found myself needing an "iter_at_least_once" method on Rust iterators and I was a little surprised to not find it in the sea of methods from itertools. I've not needed this behaviour before (that I can recall) and its not particularly complicated to implement but it got me thinking...
               
            
            
                23.10.2025 12:39 β π 0    π 0    π¬ 1    π 0                      
            
         
            
        
            
            
            
            
            
    
    
    
    
            Steve is leaving us at Oxide ππππππππ
But also going to go work at ERSC to help #jj-vcs take over the world, and I couldn't possibly be more excited about that
               
            
            
                22.10.2025 19:00 β π 140    π 5    π¬ 2    π 0                      
            
         
            
        
            
            
            
            
            
    
    
    
    
            reasons that The Diamond Age is science fictionβs most accurate prediction of the future:
               
            
            
                12.10.2025 17:44 β π 29    π 3    π¬ 2    π 0                      
            
         
            
        
            
            
            
            
                                                
                                            
Erik Meijer
@headinthebox
"... Guido van Rossum: I honestly think the importance of the GIL removal project has been overstated. It serves the needs of the largest users (e.g. Meta) while complicating things for potential contributors to the CPython code base (proving that new code does not introduce concurrency bugs is hard) ...". [0]
It does not even sever the needs of Meta; the actual reason was simply to do something impressive sounding ("until now every previous attempt failed miserably") allowed a few engineers at Meta to claim "industry wide impact" during their performance review.
                                                
    
    
    
    
            reminder: the primary goal of most enterprises is to produce goods and services for its customers. the primary goal of meta is to evaluate its employees
               
            
            
                11.10.2025 00:33 β π 31    π 3    π¬ 2    π 1                      
            
         
            
        
            
            
            
            
            
    
    
    
    
            I've not got any docs in place for anything yet, and there are almost certainly going to be multiple things changing before I can call this ready to release into the wild but for anyone curious this is what writing your WM ends up looking like: github.com/sminez/penro...
               
            
            
                05.10.2025 10:56 β π 0    π 0    π¬ 0    π 0                      
            
         
            
        
            
            
                            
            
            
            
    
    
    
    
            Quick update on where I'm at with github.com/sminez/penrosx
The ffi layer has been torn apart and rewritten compared to what I had back in April and I've got scratchpads working now after wiring in the ability to query properties from windows.
Still got several bugs to sort but it's looking good!
               
            
            
                05.10.2025 10:55 β π 1    π 0    π¬ 1    π 0                      
            
         
            
        
            
            
            
            
            
    
    
    
    
            Always good when the options available to you are:
1. String parsing from an ffi debug repr
2. Using an API that's been marked as deprecated for over a decade
3. Casting undocumented void pointers
How's _your_ morning going?
               
            
            
                02.10.2025 07:38 β π 0    π 0    π¬ 0    π 0                      
            
         
            
        
            
            
            
            
            
    
    
    
    
            Nice!
I got built in hotkey management working for penrosx at the weekend and significantly tidied up the internal APIs from what I had earlier in the year. Hoping to sort out the event handler logic where it's messed up this week then I should have something working π€
               
            
            
                29.09.2025 15:01 β π 0    π 0    π¬ 0    π 0                      
            
         
            
        
            
        
            
            
            
            
            
    
    
    
    
            to the older crowd: "oh yeah so btw he has a new linux distro and of course it uses the transphobic window manager"
to the newer crowd: "oh yeah so btw he built a web framework and also has been moving further and further right for years"
               
            
            
                25.09.2025 17:40 β π 356    π 38    π¬ 26    π 5                      
            
         
            
        
            
            
            
            
            
    
    
            
                            
                        
                crates.io: Malicious crates faster_log and async_println | Rust Blog
                Empowering everyone to build reliable and efficient software.
            
        
    
    
            The crates.βio team was notified of two malicious crates (with similar names as legitimate crates) which were actively searching file contents for Etherum private keys, Solana private keys, and arbitrary byte arrays for exfiltration.
See the blog post for details: blog.rust-lang.org/2025/09/24/c...
               
            
            
                24.09.2025 20:52 β π 119    π 37    π¬ 3    π 5                      
            
         
            
        
            
            
            
            
            
    
    
    
    
            So, thanks to @lgug2z.com for getting me thinking about it all again! (and some changes in what I'm doing at work day-to-day that are reminding me why I _really_ don't like the default OSX windowing setup π±)
               
            
            
                17.09.2025 07:51 β π 1    π 0    π¬ 0    π 0                      
            
         
            
        
            
            
            
            
            
    
    
    
    
            I did the majority of the work for this earlier in the year right when I first joined Apollo but then I got the ball rolling on an interesting internal project and got distracted by working on my text editor rather than penrose π
               
            
            
                17.09.2025 07:51 β π 1    π 0    π¬ 1    π 0                      
            
         
            
        
            
        
            
            
            
            
            
    
    
    
    
            Looking at the treesitter repo GitHub I can find a bunch of issues and discussions where people are confused about this API but no real examples of how to use it correctly. Are you really supposed to fully retokenize everything each time there's an edit?...
               
            
            
                07.09.2025 19:02 β π 0    π 0    π¬ 0    π 0                      
            
         
            
        
            
            
            
            
            
    
    
    
    
            The API claims that it can tell you changed ranges but the data I get back seems obviously incorrect: deleting a character from a function name should offset everything after it by 1...right? But the treesitter doesn't report any changes outside of the line the edit was made on for some reason π
               
            
            
                07.09.2025 18:56 β π 0    π 0    π¬ 1    π 0                      
            
         
            
        
            
            
            
            
            
    
    
    
    
            Things are pretty snappy now (under 1ms to tokenize and highlight on-screen buffer content) but I still can't for the life of me work out how to get treesitter to tell me which parts of the existing token tree are reusable following an edit π±
               
            
            
                07.09.2025 18:56 β π 0    π 0    π¬ 1    π 0                      
            
         
            
        
            
            
            
            
            
    
    
    
    
            I managed to get an 18% speedup for syntax highlighting in my text editor over the weekend, mostly thanks to making some improvements to the underlying gap buffer implementation, but also a fair amount of "wait...why on earth am I doing _that_?" thrown in there.
               
            
            
                07.09.2025 18:56 β π 0    π 0    π¬ 1    π 0                      
            
         
            
        
            
            
            
            
                                                
                                            "this game plans to unlock in approximately 6 hours"
                                                
    
    
    
    
            So close...
               
            
            
                04.09.2025 07:35 β π 1    π 0    π¬ 0    π 0                      
            
         
            
        
            
            
            
            
            
    
    
            
            
            
                YouTube video by Switch Angel
                2 Minute Deep Acid in Strudel (from scratch)
            
         
    
    
            declarative musicβ½
youtu.be/HkgV_-nJOuE?...
               
            
            
                31.08.2025 21:47 β π 44    π 3    π¬ 25    π 1                      
            
         
            
        
            
            
            
            
            
    
    
    
    
            I have an idea of where the problem is but this part of the code base always makes me a little wary, as I'm a little worried its that "Mr Burns has so many illnesses they cancel one another out" situation.
               
            
            
                31.08.2025 21:50 β π 0    π 0    π¬ 0    π 0                      
            
         
            
        
            
            
            
            
            
    
    
    
    
            Managed to make multiple performance improvements to my text editor this weekend after finally getting round to adding support for LSP based completions and formatting π
I've also had a user report a nasty crash coming from busted utf8 handling in the handwritten gap buffer implementation I have π¬
               
            
            
                31.08.2025 21:49 β π 0    π 0    π¬ 1    π 0                      
            
         
            
        
            
            
            
            
            
    
    
    
    
            How to make the rust analyzer devs angry in a single outer function
               
            
            
                23.08.2025 16:42 β π 32    π 3    π¬ 2    π 0                      
            
         
            
        
            
            
            
            
            
    
    
    
    
            Have you ever considered that your PM is βvibe codingβ you
               
            
            
                18.08.2025 22:50 β π 479    π 71    π¬ 31    π 8                      
            
         
            
        
            
            
            
            
            
    
    
    
    
            After a full day of shouting "first try!" each time I tried to get something working (and failing) yesterday, I've sat down this morning with a fresh cup of coffee and indeed managed to get it working first try π
               
            
            
                19.08.2025 08:15 β π 1    π 0    π¬ 0    π 0                      
            
         
            
        
            
            
            
            
            
    
    
    
    
            Oh boy...exhibit $n+1 of the ADHD issue of heading out to the shop to get something because you need it to cook dinner, only to return home and find out that you have 3 of the damn thing already in a cupboard you forgot to check π€¦ββοΈ
               
            
            
                17.08.2025 17:54 β π 0    π 0    π¬ 0    π 0                      
            
         
            
        
            
            
            
            
            
    
    
            
                            
                        
                ad
                an adaptable text editor
            
        
    
    
            A little bit of a bumpy experience (I assume because they've got a LOT of new users atm) but I've just migrated ad to Codeberg π 
codeberg.org/sminez/ad
(now for the rest of my repos and then updating meta-data for cargo...)
               
            
            
                13.08.2025 07:25 β π 2    π 0    π¬ 0    π 0                      
            
         
            
        
            
            
            
            
            
    
    
    
    
            Yeah I've had several people recommend codeberg to me now. To be honest, I like the more minimal UI compared to GitHub. And CI wise for my personal projects I never have anything that complicated in place so hopefully I should be fine on that front π
               
            
            
                12.08.2025 08:25 β π 0    π 0    π¬ 0    π 0                      
            
         
    
         
        
            
        
                            
                    
                    
                                            Technology-focused link-aggregation community. 
Using /newest.rss feed. Not affiliated with lobste.rs.
Currently beta; by @mycroft.mkz.me
                                     
                            
                    
                    
                                            unmappable territory
please leave a message after the beep
                                     
                            
                    
                    
                                    
                            
                    
                    
                                            Doing fundamental research in UI and 2D graphics
                                     
                            
                    
                    
                                            Free and Open Source Software developer. #rustlang developer, working on the language, library, and Cargo. he/him or they/them
[bridged from https://social.joshtriplett.org/users/josh on the fediverse by https://fed.brid.gy/ ]
                                     
                            
                    
                    
                                            Board game designer (Fox in the Forest, Hocus, Foresight) and terrible music blogger (fiverandomsongs.com). (He/him)
                                     
                            
                    
                    
                                    
                            
                    
                    
                                            Software Engineer at Apollo GraphQL, husband, cat father etc. Follow here for drums, baking, software and whatever else fun I find in the moment!
                                     
                            
                    
                    
                                            I do programming theatre. The 0.1X engineer. He/Him. Ferris is my spirit animal.
http://hachyderm.io/web/@simlay
https://github.com/simlay/
                                     
                            
                    
                    
                                            absolutely will not shut up about programming languages. apparently also now the calendar guy
(he/him)
                                     
                            
                    
                    
                                            Made https://neocities.org, https://geocities.restorativland.org, buncha other stuff. Tech/90s computing. Strong opinions loosely held. Old school rubyist.
                                     
                            
                    
                    
                                            Official account of the C Programming Language, invented by Immanuel Kant in 1799 at Bell Labs KΓΆnigsberg
                                     
                            
                    
                    
                                            A programming language empowering everyone to build reliable and efficient software.
Website: https://rust-lang.org/
Blog: https://blog.rust-lang.org/
Mastodon: https://social.rust-lang.org/@rust
                                     
                            
                    
                    
                                            AI writer at the Economist. I write about it, that is. Iβm still human. One of literally dozens of people online who is not American.
                                     
                            
                    
                    
                                            πΈ Making intriguing worlds with heart
πΈ Streets of Fortuna, Dwarf Fortress, Caves of Qud, Ostranauts 
πΈ Join: http://discord.gg/kitfoxgames
                                     
                            
                    
                    
                                            I make games
https://managore.itch.io/
https://bit.ly/leapyearonsteam
                                     
                            
                    
                    
                                            Roguelike Radio is a community run podcast and features a broad spectrum of hosts and guests talking about roguelikes and roguelike game design from player and developer perspectives. Subscribe on Apple Podcasts or visit http://www.roguelikeradio.com
                                     
                            
                    
                    
                                            Ever-learning mathematician trying to do work in maths, AI, game dev, writing and digital art. π¦πΊ
π Site | https://www.brettwitty.net
𦣠Mastodon | https://mstdn.social/@brettwitty
π° Newsletter | https://the-creative-process.ghost.io
                                     
                            
                    
                    
                                            Affable rogue, co-host of Roguelike Radio, roguelike developer, writer for Fallout London, Skywind and various other bits, and huge Tolkien nerd
                                     
                            
                    
                    
                                            making: http://patjw.itch.io/recreant