Vendor dependencies

This commit is contained in:
2026-08-01 16:11:49 +03:00
parent 7f139a0241
commit 6b5e7f0f8b
29706 changed files with 9575646 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
use std::error::Error;
use std::io::{self, BufRead, Write};
use unicode_segmentation::UnicodeSegmentation;
fn main() -> Result<(), Box<dyn Error>> {
let stdin = io::stdin();
let mut stdin = stdin.lock();
let mut stdout = io::BufWriter::new(io::stdout());
let mut line = String::new();
while stdin.read_line(&mut line)? > 0 {
let end = line
.grapheme_indices(true)
.map(|(start, g)| start + g.len())
.take(10)
.last()
.unwrap_or(line.len());
stdout.write_all(line[..end].trim_end().as_bytes())?;
stdout.write_all(b"\n")?;
line.clear();
}
Ok(())
}
+22
View File
@@ -0,0 +1,22 @@
use std::error::Error;
use std::io::{self, Write};
use bstr::{io::BufReadExt, ByteSlice};
fn main() -> Result<(), Box<dyn Error>> {
let stdin = io::stdin();
let mut stdout = io::BufWriter::new(io::stdout());
stdin.lock().for_byte_line_with_terminator(|line| {
let end = line
.grapheme_indices()
.map(|(_, end, _)| end)
.take(10)
.last()
.unwrap_or(line.len());
stdout.write_all(line[..end].trim_end())?;
stdout.write_all(b"\n")?;
Ok(true)
})?;
Ok(())
}
+17
View File
@@ -0,0 +1,17 @@
use std::error::Error;
use std::io::{self, BufRead, Write};
fn main() -> Result<(), Box<dyn Error>> {
let stdin = io::stdin();
let mut stdin = stdin.lock();
let mut stdout = io::BufWriter::new(io::stdout());
let mut line = String::new();
while stdin.read_line(&mut line)? > 0 {
if line.contains("Dimension") {
stdout.write_all(line.as_bytes())?;
}
line.clear();
}
Ok(())
}
+17
View File
@@ -0,0 +1,17 @@
use std::error::Error;
use std::io::{self, Write};
use bstr::{io::BufReadExt, ByteSlice};
fn main() -> Result<(), Box<dyn Error>> {
let stdin = io::stdin();
let mut stdout = io::BufWriter::new(io::stdout());
stdin.lock().for_byte_line_with_terminator(|line| {
if line.contains_str("Dimension") {
stdout.write_all(line)?;
}
Ok(true)
})?;
Ok(())
}
+15
View File
@@ -0,0 +1,15 @@
use std::error::Error;
use std::io::{self, BufRead, Write};
fn main() -> Result<(), Box<dyn Error>> {
let stdin = io::stdin();
let mut stdin = stdin.lock();
let mut stdout = io::BufWriter::new(io::stdout());
let mut line = String::new();
while stdin.read_line(&mut line)? > 0 {
stdout.write_all(line.to_uppercase().as_bytes())?;
line.clear();
}
Ok(())
}
+18
View File
@@ -0,0 +1,18 @@
use std::error::Error;
use std::io::{self, Write};
use bstr::{io::BufReadExt, ByteSlice};
fn main() -> Result<(), Box<dyn Error>> {
let stdin = io::stdin();
let mut stdout = io::BufWriter::new(io::stdout());
let mut upper = vec![];
stdin.lock().for_byte_line_with_terminator(|line| {
upper.clear();
line.to_uppercase_into(&mut upper);
stdout.write_all(&upper)?;
Ok(true)
})?;
Ok(())
}
+18
View File
@@ -0,0 +1,18 @@
use std::error::Error;
use std::io::{self, BufRead};
use unicode_segmentation::UnicodeSegmentation;
fn main() -> Result<(), Box<dyn Error>> {
let stdin = io::stdin();
let mut stdin = stdin.lock();
let mut words = 0;
let mut line = String::new();
while stdin.read_line(&mut line)? > 0 {
words += line.unicode_words().count();
line.clear();
}
println!("{}", words);
Ok(())
}
+15
View File
@@ -0,0 +1,15 @@
use std::error::Error;
use std::io;
use bstr::{io::BufReadExt, ByteSlice};
fn main() -> Result<(), Box<dyn Error>> {
let stdin = io::stdin();
let mut words = 0;
stdin.lock().for_byte_line_with_terminator(|line| {
words += line.words().count();
Ok(true)
})?;
println!("{}", words);
Ok(())
}