Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ update.sh
.zsh_history
.zshrc
/.fish
.vscode/**/*
166 changes: 120 additions & 46 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ debug = true
[dependencies]
chrono = "0.4"
csv = "1"
crossterm = "0.18"
humantime = "2.1"
directories-next = "2.0"
itertools = "0.10"
Expand All @@ -26,7 +27,6 @@ rand = "0.8"
regex = "1"
relative-path = "1.7"
shellexpand = "2.1"
termion = "1.5"
unicode-segmentation = "1.9"

[dependencies.rusqlite]
Expand Down
13 changes: 13 additions & 0 deletions src/fixed_length_grapheme_string.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::io::Write;
use unicode_segmentation::UnicodeSegmentation;

#[derive(Debug)]
Expand All @@ -7,6 +8,18 @@ pub struct FixedLengthGraphemeString {
pub max_grapheme_length: u16,
}

impl Write for FixedLengthGraphemeString {
fn write(&mut self, buf: &[u8]) -> std::io::Result<usize> {
let s = String::from_utf8(buf.to_vec()).unwrap();
self.push_str(&s);
Ok(s.len())
}

fn flush(&mut self) -> std::io::Result<()> {
Ok(())
}
}

impl FixedLengthGraphemeString {
pub fn empty(max_grapheme_length: u16) -> FixedLengthGraphemeString {
FixedLengthGraphemeString {
Expand Down
Loading