mirror of
https://github.com/nushell/nushell.git
synced 2025-08-14 02:28:35 +02:00
Remove unused dependencies (#6945)
* Remove unused dependencies Inspired by #6938 ran `cargo +nightly udeps --features extra`. Removes 2 crates and should remove an unnecessary intra-workspace dependency which might open up further opportunities for compilation. * Make windows-only dependency conditional in toml `omnipath` is only used on Windows and already behind a `#[cfg]` block in the code. Made the dependency in `Cargo.toml` conditional as well. * Make `nu-pretty-hex` example a proper example This allows making `rand` a dev-dependency in this crate.
This commit is contained in:
committed by
GitHub
parent
4f7f6a2932
commit
ce4ae00a6f
51
crates/nu-pretty-hex/examples/demo.rs
Normal file
51
crates/nu-pretty-hex/examples/demo.rs
Normal file
@ -0,0 +1,51 @@
|
||||
use nu_pretty_hex::*;
|
||||
|
||||
fn main() {
|
||||
let config = HexConfig {
|
||||
title: true,
|
||||
ascii: true,
|
||||
width: 16,
|
||||
group: 4,
|
||||
chunk: 1,
|
||||
address_offset: 0,
|
||||
skip: Some(10),
|
||||
// length: Some(5),
|
||||
// length: None,
|
||||
length: Some(50),
|
||||
};
|
||||
|
||||
let my_string = "Darren Schroeder 😉";
|
||||
println!("ConfigHex\n{}\n", config_hex(&my_string, config));
|
||||
println!("SimpleHex\n{}\n", simple_hex(&my_string));
|
||||
println!("PrettyHex\n{}\n", pretty_hex(&my_string));
|
||||
println!("ConfigHex\n{}\n", config_hex(&my_string, config));
|
||||
|
||||
// let mut my_str = String::new();
|
||||
// for x in 0..256 {
|
||||
// my_str.push(x as u8);
|
||||
// }
|
||||
let mut v: Vec<u8> = vec![];
|
||||
for x in 0..=127 {
|
||||
v.push(x);
|
||||
}
|
||||
let my_str = String::from_utf8_lossy(&v[..]);
|
||||
|
||||
println!("First128\n{}\n", pretty_hex(&my_str.as_bytes()));
|
||||
println!(
|
||||
"First128-Param\n{}\n",
|
||||
config_hex(&my_str.as_bytes(), config)
|
||||
);
|
||||
|
||||
let mut r_str = String::new();
|
||||
for _ in 0..=127 {
|
||||
r_str.push(rand::random::<u8>() as char);
|
||||
}
|
||||
|
||||
println!("Random127\n{}\n", pretty_hex(&r_str));
|
||||
}
|
||||
|
||||
//chunk 0 44617272656e20536368726f65646572 Darren Schroeder
|
||||
//chunk 1 44 61 72 72 65 6e 20 53 63 68 72 6f 65 64 65 72 Darren Schroeder
|
||||
//chunk 2 461 7272 656e 2053 6368 726f 6564 6572 Darren Schroeder
|
||||
//chunk 3 46172 72656e 205363 68726f 656465 72 Darren Schroeder
|
||||
//chunk 4 44617272 656e2053 6368726f 65646572 Darren Schroeder
|
Reference in New Issue
Block a user