diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md deleted file mode 100644 index 1df76de..0000000 --- a/.github/ISSUE_TEMPLATE/bug-report.md +++ /dev/null @@ -1,12 +0,0 @@ ---- -name: Bug Report -about: Any Ouch bug -title: '_[BUG]_ ' -labels: bug -assignees: '' - ---- - -Thanks for filling a bug report! - -Don't forget to add the `ouch` version for which this error occurred. diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml new file mode 100644 index 0000000..9c5e36d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -0,0 +1,40 @@ +name: Bug Report +description: Report a ouch bug +labels: [bug] +body: + - type: markdown + attributes: + value: Thanks for filling a bug report! + + - type: input + id: version + attributes: + label: Version + description: Version of ouch you encountered this error, or git commit hash if you are not using a versioned release + validations: + required: true + + - type: textarea + id: description + attributes: + label: Description + validations: + required: true + + - type: textarea + id: current + attributes: + label: Current Behavior + + - type: textarea + id: expected + attributes: + label: Expected Behavior + + - type: textarea + id: info + attributes: + label: Additional Information + description: > + Additional information that might help us debug this issue, + such as the operating system you are using or the files you tried to archive/extract diff --git a/.github/ISSUE_TEMPLATE/documentation-improvement.md b/.github/ISSUE_TEMPLATE/documentation-improvement.md index 9c0e616..b44ae39 100644 --- a/.github/ISSUE_TEMPLATE/documentation-improvement.md +++ b/.github/ISSUE_TEMPLATE/documentation-improvement.md @@ -1,10 +1,6 @@ --- name: Documentation Improvement -about: Improvements in repository markdown or code docs -title: '_[DOCS]_ ' +about: Improvements in repository markdown or code documentations labels: documentation -assignees: '' --- - - diff --git a/.github/ISSUE_TEMPLATE/feature-request.md b/.github/ISSUE_TEMPLATE/feature-request.md new file mode 100644 index 0000000..8aa482b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.md @@ -0,0 +1,6 @@ +--- +name: Feature / Enhancement +about: Features or change you want to see in ouch +labels: enhancement + +--- diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md new file mode 100644 index 0000000..dd1a7aa --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.md @@ -0,0 +1,6 @@ +--- +name: Question +about: "Ask a question about ouch. You can also ask questions in discussions: https://github.com/ouch-org/ouch/discussions" +labels: question + +--- diff --git a/src/utils/fs.rs b/src/utils/fs.rs index 389774e..31575ea 100644 --- a/src/utils/fs.rs +++ b/src/utils/fs.rs @@ -70,19 +70,19 @@ pub fn try_infer_extension(path: &Path) -> Option { buf.len() > 261 && buf[257..=261] == [0x75, 0x73, 0x74, 0x61, 0x72] } fn is_gz(buf: &[u8]) -> bool { - buf.len() > 2 && buf[..=2] == [0x1F, 0x8B, 0x8] + buf.starts_with(&[0x1F, 0x8B, 0x8]) } fn is_bz2(buf: &[u8]) -> bool { - buf.len() > 2 && buf[..=2] == [0x42, 0x5A, 0x68] + buf.starts_with(&[0x42, 0x5A, 0x68]) } fn is_xz(buf: &[u8]) -> bool { - buf.len() > 5 && buf[..=5] == [0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00] + buf.starts_with(&[0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00]) } fn is_lz4(buf: &[u8]) -> bool { - buf.len() > 3 && buf[..=3] == [0x04, 0x22, 0x4D, 0x18] + buf.starts_with(&[0x04, 0x22, 0x4D, 0x18]) } fn is_zst(buf: &[u8]) -> bool { - buf.len() > 3 && buf[..=3] == [0x28, 0xB5, 0x2F, 0xFD] + buf.starts_with(&[0x28, 0xB5, 0x2F, 0xFD]) } let buf = {