Fix lessopen feature

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
This commit is contained in:
Matt Helsley 2024-10-03 16:08:07 -07:00
parent 61c9f312c9
commit 3e5f4266ce
2 changed files with 2 additions and 2 deletions

View File

@ -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:

View File

@ -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()),
)