Skip to content

Commit

Permalink
Merge pull request #245 from lafrenierejm/nix-flake-update
Browse files Browse the repository at this point in the history
Update Nix dependencies and fix Clippy warnings
  • Loading branch information
phiresky authored Sep 1, 2024
2 parents e207c12 + 5675e68 commit 385a8a9
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 53 deletions.
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ readme = "README.md"
repository = "https://github.com/phiresky/ripgrep-all"
version = "0.10.6"

[features]
default = ["perf-literal"]
perf-literal = ["regex/perf-literal"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
Expand Down
49 changes: 19 additions & 30 deletions flake.lock

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

14 changes: 4 additions & 10 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,13 @@

crane = {
url = "github:ipetkov/crane";
inputs.nixpkgs.follows = "nixpkgs";
};

flake-utils.url = "github:numtide/flake-utils";

rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
inputs.nixpkgs.follows = "nixpkgs";
};

advisory-db = {
Expand All @@ -26,10 +22,7 @@

pre-commit-hooks = {
url = "github:cachix/pre-commit-hooks.nix";
inputs = {
nixpkgs.follows = "nixpkgs";
flake-utils.follows = "flake-utils";
};
inputs.nixpkgs.follows = "nixpkgs";
};
};

Expand All @@ -48,7 +41,8 @@
overlays = [(import rust-overlay)];
};

craneLib = crane.lib.${system};
craneLib = crane.mkLib nixpkgs.legacyPackages.${system};

src = pkgs.lib.cleanSourceWith {
src = craneLib.path ./.;
filter = pkgs.lib.cleanSourceFilter;
Expand Down
3 changes: 2 additions & 1 deletion src/adapters/custom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ pub struct CustomAdapterConfig {
/// - $input_file_extension: the file extension (without dot). e.g. foo.tar.gz -> gz
/// - $input_file_stem, the file name without the last extension. e.g. foo.tar.gz -> foo.tar
/// - $input_virtual_path: the full input file path. Note that this path may not actually exist on disk because it is the result of another adapter
///
/// stdin of the program will be connected to the input file, and stdout is assumed to be the converted file
pub args: Vec<String>,
/// The output path hint. The placeholders are the same as for `.args`
Expand Down Expand Up @@ -103,7 +104,7 @@ lazy_static! {
extensions: strs(&["epub", "odt", "docx", "fb2", "ipynb", "html", "htm"]),
binary: "pandoc".to_string(),
mimetypes: None,
// simpler markown (with more information loss but plainer text)
// simpler markdown (with more information loss but plainer text)
//.arg("--to=commonmark-header_attributes-link_attributes-fenced_divs-markdown_in_html_blocks-raw_html-native_divs-native_spans-bracketed_spans")
args: strs(&[
"--from=$input_file_extension",
Expand Down
24 changes: 12 additions & 12 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ fn is_default<T: Default + PartialEq>(t: &T) -> bool {
#[derive(JsonSchema, Debug, Serialize, Deserialize, Copy, Clone, PartialEq, FromStr)]
pub struct CacheCompressionLevel(pub i32);

impl ToString for CacheCompressionLevel {
fn to_string(&self) -> String {
self.0.to_string()
impl std::fmt::Display for CacheCompressionLevel {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.0)
}
}
impl Default for CacheCompressionLevel {
Expand All @@ -31,9 +31,9 @@ impl Default for CacheCompressionLevel {
#[derive(JsonSchema, Debug, Serialize, Deserialize, Copy, Clone, PartialEq, FromStr)]
pub struct MaxArchiveRecursion(pub i32);

impl ToString for MaxArchiveRecursion {
fn to_string(&self) -> String {
self.0.to_string()
impl std::fmt::Display for MaxArchiveRecursion {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.0)
}
}
impl Default for MaxArchiveRecursion {
Expand All @@ -45,9 +45,9 @@ impl Default for MaxArchiveRecursion {
#[derive(JsonSchema, Debug, Serialize, Deserialize, Clone, PartialEq, FromStr)]
pub struct CachePath(pub String);

impl ToString for CachePath {
fn to_string(&self) -> String {
self.0.to_string()
impl std::fmt::Display for CachePath {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.0)
}
}
impl Default for CachePath {
Expand All @@ -61,9 +61,9 @@ impl Default for CachePath {
#[derive(JsonSchema, Debug, Serialize, Deserialize, Copy, Clone, PartialEq, Eq)]
pub struct CacheMaxBlobLen(pub usize);

impl ToString for CacheMaxBlobLen {
fn to_string(&self) -> String {
self.0.to_string()
impl std::fmt::Display for CacheMaxBlobLen {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.0)
}
}
impl Default for CacheMaxBlobLen {
Expand Down

0 comments on commit 385a8a9

Please sign in to comment.