Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "CodeQL"

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '0 0 * * 0'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
security-events: write
actions: read
contents: read

strategy:
fail-fast: false
matrix:
# focus on Rust code only
language: [ 'rust']

steps:
- name: Checkout repository
Comment thread
anidroid1184 marked this conversation as resolved.
uses: actions/checkout@v4
Comment thread
coderabbitai[bot] marked this conversation as resolved.
with:
persist-credentials: false

- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{ matrix.language }}"

4 changes: 2 additions & 2 deletions crates/tinyxml2/src/entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ pub fn decode_numeric_only(input: &str) -> String {

/// Attempts to decode a single numeric entity reference starting at the given byte slice.
fn try_decode_numeric_entity(bytes: &[u8]) -> Option<(char, usize)> {
debug_assert!(bytes[0] == b'&');
debug_assert_eq!(bytes[0], b'&');

// Find the semicolon
let semi_pos = bytes.iter().position(|&b| b == b';')?;
Expand Down Expand Up @@ -165,7 +165,7 @@ fn try_decode_numeric_entity(bytes: &[u8]) -> Option<(char, usize)> {
/// Returns `Some((char, bytes_consumed))` if a valid entity was decoded,
/// or `None` if the input does not start with a valid entity reference.
fn try_decode_entity(bytes: &[u8]) -> Option<(char, usize)> {
debug_assert!(bytes[0] == b'&');
debug_assert_eq!(bytes[0], b'&');

// Find the semicolon
let semi_pos = bytes.iter().position(|&b| b == b';')?;
Expand Down
5 changes: 2 additions & 3 deletions tests/compat/harness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,9 @@ fn find_workspace_root() -> Option<PathBuf> {
if dir.join("tests").join("corpus").exists() {
return Some(dir);
}
if let Some(parent) = dir.parent() {
{
let parent = dir.parent()?;
dir = parent.to_path_buf();
} else {
return None;
}
}
}
Expand Down
Loading