Rust Line Iterator

What to do? Read lines from some content and iterate over each line. Source code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 usestd::str;struct LineIter<'a>{content: &'astr,offset: usize,length: usize,}impl<'a>LineIter<'a>{fn new(content: &'astr)-> Self{LineIter{content,offset: 0,length: content.

Rust References Rules

References Rules / Borrowing Rules At any given time, we can have either one mutable reference or any number of immutable references. References must always be valid Rule 1 At any given time, we can have either one mutable reference or any number of immutable references. Breaks this rule will cause errors: E0499: A variable was borrowed as mutable more than once.

Emacs Org Paste images

The package org-download can help emacs integrate with ImageMagick and xclip to paste images into org files. chage Install ImageMagick on Arch Linux 1 ❯ sudo pacman -S imagemagick Install xclip on Arch Linux 1 ❯ sudo pacman -S xclip Save screenshot to clipboard 1 ❯ import png:- | xclip -selection c -t image/png Add the code below in i3wm config file ~/.

Linux command: uptime

1 2 ❯ uptime 21:40:03 up 4 days, 10:27, 2 users, load average: 0.40, 0.54, 0.55 The current time: 21:40:03 How long the system has been running: up 4 days, 10:27 (up 4 days, 10 hours, 27 minutes) The system load averages for the past 1, 5, and 15 minutes the past 1 minute: 0.