Shuu12121/CodeModernBERT-Crow-v3-len1024
Fill-Mask • 0.1B • Updated • 50
repo stringlengths 6 65 | file_url stringlengths 81 311 | file_path stringlengths 6 227 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:31:58 2026-01-04 20:25:31 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
sharkdp/fd | https://github.com/sharkdp/fd/blob/5f95a781212e3efbc6d91ae50e0ca0ce0693da50/src/config.rs | src/config.rs | use std::{path::PathBuf, sync::Arc, time::Duration};
use lscolors::LsColors;
use regex::bytes::RegexSet;
use crate::exec::CommandSet;
use crate::filetypes::FileTypes;
#[cfg(unix)]
use crate::filter::OwnerFilter;
use crate::filter::{SizeFilter, TimeFilter};
use crate::fmt::FormatTemplate;
/// Configuration options fo... | rust | Apache-2.0 | 5f95a781212e3efbc6d91ae50e0ca0ce0693da50 | 2026-01-04T15:31:59.463143Z | false |
sharkdp/fd | https://github.com/sharkdp/fd/blob/5f95a781212e3efbc6d91ae50e0ca0ce0693da50/src/hyperlink.rs | src/hyperlink.rs | use crate::filesystem::absolute_path;
use std::fmt::{self, Formatter, Write};
use std::path::{Path, PathBuf};
pub(crate) struct PathUrl(PathBuf);
impl PathUrl {
pub(crate) fn new(path: &Path) -> Option<PathUrl> {
Some(PathUrl(absolute_path(path).ok()?))
}
}
impl fmt::Display for PathUrl {
fn fmt(... | rust | Apache-2.0 | 5f95a781212e3efbc6d91ae50e0ca0ce0693da50 | 2026-01-04T15:31:59.463143Z | false |
sharkdp/fd | https://github.com/sharkdp/fd/blob/5f95a781212e3efbc6d91ae50e0ca0ce0693da50/src/filesystem.rs | src/filesystem.rs | use std::borrow::Cow;
use std::env;
use std::ffi::OsStr;
use std::fs;
use std::io;
#[cfg(any(unix, target_os = "redox"))]
use std::os::unix::fs::FileTypeExt;
use std::path::{Path, PathBuf};
use normpath::PathExt;
use crate::dir_entry;
pub fn path_absolute_form(path: &Path) -> io::Result<PathBuf> {
if path.is_abs... | rust | Apache-2.0 | 5f95a781212e3efbc6d91ae50e0ca0ce0693da50 | 2026-01-04T15:31:59.463143Z | false |
sharkdp/fd | https://github.com/sharkdp/fd/blob/5f95a781212e3efbc6d91ae50e0ca0ce0693da50/src/cli.rs | src/cli.rs | use std::num::NonZeroUsize;
use std::path::{Path, PathBuf};
use std::time::Duration;
use anyhow::anyhow;
use clap::{
Arg, ArgAction, ArgGroup, ArgMatches, Command, Parser, ValueEnum, error::ErrorKind,
value_parser,
};
#[cfg(feature = "completions")]
use clap_complete::Shell;
use normpath::PathExt;
use crate::... | rust | Apache-2.0 | 5f95a781212e3efbc6d91ae50e0ca0ce0693da50 | 2026-01-04T15:31:59.463143Z | true |
sharkdp/fd | https://github.com/sharkdp/fd/blob/5f95a781212e3efbc6d91ae50e0ca0ce0693da50/src/error.rs | src/error.rs | pub fn print_error(msg: impl Into<String>) {
eprintln!("[fd error]: {}", msg.into());
}
| rust | Apache-2.0 | 5f95a781212e3efbc6d91ae50e0ca0ce0693da50 | 2026-01-04T15:31:59.463143Z | false |
sharkdp/fd | https://github.com/sharkdp/fd/blob/5f95a781212e3efbc6d91ae50e0ca0ce0693da50/src/walk.rs | src/walk.rs | use std::borrow::Cow;
use std::ffi::OsStr;
use std::io::{self, Write};
use std::mem;
use std::path::PathBuf;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::{Arc, Mutex, MutexGuard};
use std::thread;
use std::time::{Duration, Instant};
use anyhow::{Result, anyhow};
use crossbeam_channel::{Receiver, RecvT... | rust | Apache-2.0 | 5f95a781212e3efbc6d91ae50e0ca0ce0693da50 | 2026-01-04T15:31:59.463143Z | false |
sharkdp/fd | https://github.com/sharkdp/fd/blob/5f95a781212e3efbc6d91ae50e0ca0ce0693da50/src/dir_entry.rs | src/dir_entry.rs | use std::cell::OnceCell;
use std::ffi::OsString;
use std::fs::{FileType, Metadata};
use std::path::{Path, PathBuf};
use lscolors::{Colorable, LsColors, Style};
use crate::config::Config;
use crate::filesystem::strip_current_dir;
#[derive(Debug)]
enum DirEntryInner {
Normal(ignore::DirEntry),
BrokenSymlink(Pa... | rust | Apache-2.0 | 5f95a781212e3efbc6d91ae50e0ca0ce0693da50 | 2026-01-04T15:31:59.463143Z | false |
sharkdp/fd | https://github.com/sharkdp/fd/blob/5f95a781212e3efbc6d91ae50e0ca0ce0693da50/src/exit_codes.rs | src/exit_codes.rs | use std::process;
#[cfg(unix)]
use nix::sys::signal::{SigHandler, Signal, raise, signal};
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum ExitCode {
Success,
HasResults(bool),
GeneralError,
KilledBySigint,
}
impl From<ExitCode> for i32 {
fn from(code: ExitCode) -> Self {
match code ... | rust | Apache-2.0 | 5f95a781212e3efbc6d91ae50e0ca0ce0693da50 | 2026-01-04T15:31:59.463143Z | false |
sharkdp/fd | https://github.com/sharkdp/fd/blob/5f95a781212e3efbc6d91ae50e0ca0ce0693da50/src/main.rs | src/main.rs | mod cli;
mod config;
mod dir_entry;
mod error;
mod exec;
mod exit_codes;
mod filesystem;
mod filetypes;
mod filter;
mod fmt;
mod hyperlink;
mod output;
mod regex_helper;
mod walk;
use std::env;
use std::io::IsTerminal;
use std::path::Path;
use std::sync::Arc;
use anyhow::{Context, Result, anyhow, bail};
use clap::{Co... | rust | Apache-2.0 | 5f95a781212e3efbc6d91ae50e0ca0ce0693da50 | 2026-01-04T15:31:59.463143Z | false |
sharkdp/fd | https://github.com/sharkdp/fd/blob/5f95a781212e3efbc6d91ae50e0ca0ce0693da50/src/output.rs | src/output.rs | use std::borrow::Cow;
use std::io::{self, Write};
use lscolors::{Indicator, LsColors, Style};
use crate::config::Config;
use crate::dir_entry::DirEntry;
use crate::fmt::FormatTemplate;
use crate::hyperlink::PathUrl;
fn replace_path_separator(path: &str, new_path_separator: &str) -> String {
path.replace(std::pat... | rust | Apache-2.0 | 5f95a781212e3efbc6d91ae50e0ca0ce0693da50 | 2026-01-04T15:31:59.463143Z | false |
sharkdp/fd | https://github.com/sharkdp/fd/blob/5f95a781212e3efbc6d91ae50e0ca0ce0693da50/src/filetypes.rs | src/filetypes.rs | use crate::dir_entry;
use crate::filesystem;
use faccess::PathExt;
/// Whether or not to show
#[derive(Default)]
pub struct FileTypes {
pub files: bool,
pub directories: bool,
pub symlinks: bool,
pub block_devices: bool,
pub char_devices: bool,
pub sockets: bool,
pub pipes: bool,
pub e... | rust | Apache-2.0 | 5f95a781212e3efbc6d91ae50e0ca0ce0693da50 | 2026-01-04T15:31:59.463143Z | false |
sharkdp/fd | https://github.com/sharkdp/fd/blob/5f95a781212e3efbc6d91ae50e0ca0ce0693da50/src/regex_helper.rs | src/regex_helper.rs | use regex_syntax::ParserBuilder;
use regex_syntax::hir::Hir;
/// Determine if a regex pattern contains a literal uppercase character.
pub fn pattern_has_uppercase_char(pattern: &str) -> bool {
let mut parser = ParserBuilder::new().utf8(false).build();
parser
.parse(pattern)
.map(|hir| hir_has_... | rust | Apache-2.0 | 5f95a781212e3efbc6d91ae50e0ca0ce0693da50 | 2026-01-04T15:31:59.463143Z | false |
sharkdp/fd | https://github.com/sharkdp/fd/blob/5f95a781212e3efbc6d91ae50e0ca0ce0693da50/src/filter/time.rs | src/filter/time.rs | use jiff::{Span, Timestamp, Zoned, civil::DateTime, tz::TimeZone};
use std::time::{Duration, SystemTime, UNIX_EPOCH};
/// Filter based on time ranges.
#[derive(Debug, PartialEq, Eq)]
pub enum TimeFilter {
Before(SystemTime),
After(SystemTime),
}
#[cfg(not(test))]
fn now() -> Zoned {
Zoned::now()
}
#[cfg... | rust | Apache-2.0 | 5f95a781212e3efbc6d91ae50e0ca0ce0693da50 | 2026-01-04T15:31:59.463143Z | false |
sharkdp/fd | https://github.com/sharkdp/fd/blob/5f95a781212e3efbc6d91ae50e0ca0ce0693da50/src/filter/mod.rs | src/filter/mod.rs | pub use self::size::SizeFilter;
pub use self::time::TimeFilter;
#[cfg(unix)]
pub use self::owner::OwnerFilter;
mod size;
mod time;
#[cfg(unix)]
mod owner;
| rust | Apache-2.0 | 5f95a781212e3efbc6d91ae50e0ca0ce0693da50 | 2026-01-04T15:31:59.463143Z | false |
sharkdp/fd | https://github.com/sharkdp/fd/blob/5f95a781212e3efbc6d91ae50e0ca0ce0693da50/src/filter/owner.rs | src/filter/owner.rs | use anyhow::{Result, anyhow};
use nix::unistd::{Group, User};
use std::fs;
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct OwnerFilter {
uid: Check<u32>,
gid: Check<u32>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
enum Check<T> {
Equal(T),
NotEq(T),
Ignore,
}
impl OwnerFilter {
co... | rust | Apache-2.0 | 5f95a781212e3efbc6d91ae50e0ca0ce0693da50 | 2026-01-04T15:31:59.463143Z | false |
sharkdp/fd | https://github.com/sharkdp/fd/blob/5f95a781212e3efbc6d91ae50e0ca0ce0693da50/src/filter/size.rs | src/filter/size.rs | use std::sync::OnceLock;
use anyhow::anyhow;
use regex::Regex;
static SIZE_CAPTURES: OnceLock<Regex> = OnceLock::new();
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum SizeFilter {
Max(u64),
Min(u64),
Equals(u64),
}
// SI prefixes (powers of 10)
const KILO: u64 = 1000;
const MEGA: u64 = KILO * 100... | rust | Apache-2.0 | 5f95a781212e3efbc6d91ae50e0ca0ce0693da50 | 2026-01-04T15:31:59.463143Z | false |
sharkdp/fd | https://github.com/sharkdp/fd/blob/5f95a781212e3efbc6d91ae50e0ca0ce0693da50/src/exec/command.rs | src/exec/command.rs | use std::io;
use std::io::Write;
use argmax::Command;
use crate::error::print_error;
use crate::exit_codes::ExitCode;
struct Outputs {
stdout: Vec<u8>,
stderr: Vec<u8>,
}
pub struct OutputBuffer {
null_separator: bool,
outputs: Vec<Outputs>,
}
impl OutputBuffer {
pub fn new(null_separator: bool)... | rust | Apache-2.0 | 5f95a781212e3efbc6d91ae50e0ca0ce0693da50 | 2026-01-04T15:31:59.463143Z | false |
sharkdp/fd | https://github.com/sharkdp/fd/blob/5f95a781212e3efbc6d91ae50e0ca0ce0693da50/src/exec/mod.rs | src/exec/mod.rs | mod command;
mod job;
use std::ffi::OsString;
use std::io;
use std::iter;
use std::path::{Path, PathBuf};
use std::process::Stdio;
use anyhow::{Result, bail};
use argmax::Command;
use crate::exec::command::OutputBuffer;
use crate::exit_codes::{ExitCode, merge_exitcodes};
use crate::fmt::{FormatTemplate, Token};
use... | rust | Apache-2.0 | 5f95a781212e3efbc6d91ae50e0ca0ce0693da50 | 2026-01-04T15:31:59.463143Z | false |
sharkdp/fd | https://github.com/sharkdp/fd/blob/5f95a781212e3efbc6d91ae50e0ca0ce0693da50/src/exec/job.rs | src/exec/job.rs | use crate::config::Config;
use crate::error::print_error;
use crate::exit_codes::{ExitCode, merge_exitcodes};
use crate::walk::WorkerResult;
use super::CommandSet;
/// An event loop that listens for inputs from the `rx` receiver. Each received input will
/// generate a command with the supplied command template. The ... | rust | Apache-2.0 | 5f95a781212e3efbc6d91ae50e0ca0ce0693da50 | 2026-01-04T15:31:59.463143Z | false |
sharkdp/fd | https://github.com/sharkdp/fd/blob/5f95a781212e3efbc6d91ae50e0ca0ce0693da50/src/fmt/mod.rs | src/fmt/mod.rs | mod input;
use std::borrow::Cow;
use std::ffi::{OsStr, OsString};
use std::fmt::{self, Display, Formatter};
use std::path::{Component, Path, Prefix};
use std::sync::OnceLock;
use aho_corasick::AhoCorasick;
use self::input::{basename, dirname, remove_extension};
/// Designates what should be written to a buffer
///
... | rust | Apache-2.0 | 5f95a781212e3efbc6d91ae50e0ca0ce0693da50 | 2026-01-04T15:31:59.463143Z | false |
sharkdp/fd | https://github.com/sharkdp/fd/blob/5f95a781212e3efbc6d91ae50e0ca0ce0693da50/src/fmt/input.rs | src/fmt/input.rs | use std::ffi::{OsStr, OsString};
use std::path::{Path, PathBuf};
use crate::filesystem::strip_current_dir;
/// Removes the parent component of the path
pub fn basename(path: &Path) -> &OsStr {
path.file_name().unwrap_or(path.as_os_str())
}
/// Removes the extension from the path
pub fn remove_extension(path: &Pa... | rust | Apache-2.0 | 5f95a781212e3efbc6d91ae50e0ca0ce0693da50 | 2026-01-04T15:31:59.463143Z | false |