Skip to content

Commit

Permalink
Fix lessopen feature
Browse files Browse the repository at this point in the history
RawOsString API changed in os_str_bytes 7.0.0 and bat no longer builds
with the lessopen feature because:

- ::from_string() is deprecated and says to use new().
  The documentation says that new(), like from_string() no longer
  needs to copy the string.

- ::assert_from_raw_vec() is no longer merely deprecated and now
  requires selecting the "conversions" feature of os_str_bytes.

Replaces PR#2938
  • Loading branch information
Matt Helsley committed Oct 3, 2024
1 parent 61c9f31 commit 3e5f426
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ minimal-application = [
]
git = ["git2"] # Support indicating git modifications
paging = ["shell-words", "grep-cli"] # Support applying a pager on the output
lessopen = ["run_script", "os_str_bytes"] # Support $LESSOPEN preprocessor
lessopen = ["run_script", "os_str_bytes/conversions"] # Support $LESSOPEN preprocessor
build-assets = ["syntect/yaml-load", "syntect/plist-load", "regex", "walkdir"]

# You need to use one of these if you depend on bat as a library:
Expand Down
2 changes: 1 addition & 1 deletion src/lessopen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ impl LessOpenPreprocessor {
}

(
RawOsString::from_string(lessopen_stdout),
RawOsString::new(lessopen_stdout),
path_str.to_string(),
OpenedInputKind::OrdinaryFile(path.to_path_buf()),
)
Expand Down

0 comments on commit 3e5f426

Please sign in to comment.