From 6328df17fedec8c5ab85944ddb0e20b46542b674 Mon Sep 17 00:00:00 2001 From: Michal Rostecki Date: Sun, 29 Jan 2023 13:33:40 +0800 Subject: [PATCH 1/2] ci: Install libpolly-*-dev package Signed-off-by: Michal Rostecki --- .github/workflows/build-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 39725e84..7d18f7a2 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -73,7 +73,7 @@ jobs: wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - echo -e "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-${{ matrix.llvm }} main\n" | sudo tee /etc/apt/sources.list.d/llvm.list sudo apt-get update - sudo apt-get install llvm-${{ matrix.llvm }}-dev libclang-${{ matrix.llvm }}-dev + sudo apt-get install llvm-${{ matrix.llvm }}-dev libclang-${{ matrix.llvm }}-dev libpolly-${{ matrix.llvm }}-dev - name: Install LLVM tools if: matrix.llvm == 'rustc' From 92884b8adbbeecf227b05617a88a5992cccd5fc7 Mon Sep 17 00:00:00 2001 From: Michal Rostecki Date: Sun, 29 Jan 2023 13:41:54 +0800 Subject: [PATCH 2/2] Fix clippy warnings Signed-off-by: Michal Rostecki --- src/bin/bpf-linker.rs | 4 ++-- src/linker.rs | 3 +-- src/llvm/message.rs | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/bin/bpf-linker.rs b/src/bin/bpf-linker.rs index e9339565..acfccb2e 100644 --- a/src/bin/bpf-linker.rs +++ b/src/bin/bpf-linker.rs @@ -182,7 +182,7 @@ fn main() { Ok(s) if !s.is_empty() => match s.parse::() { Ok(l) => Some(l), Err(e) => error( - &format!("invalid RUST_LOG value: {}", e), + &format!("invalid RUST_LOG value: {e}"), clap::error::ErrorKind::InvalidValue, ), }, @@ -194,7 +194,7 @@ fn main() { Ok(f) => f, Err(e) => { error( - &format!("failed to open log file: {:?}", e), + &format!("failed to open log file: {e:?}"), clap::error::ErrorKind::Io, ); } diff --git a/src/linker.rs b/src/linker.rs index efaccb6f..d5d11071 100644 --- a/src/linker.rs +++ b/src/linker.rs @@ -12,7 +12,6 @@ use std::{ io, io::Read, io::Seek, - io::SeekFrom, path::Path, path::PathBuf, ptr, str, @@ -241,7 +240,7 @@ impl Linker { // or an invalid file file.read(&mut buf) .map_err(|e| LinkerError::IoError(path.clone(), e))?; - file.seek(SeekFrom::Start(0)) + file.rewind() .map_err(|e| LinkerError::IoError(path.clone(), e))?; let in_type = detect_input_type(&buf) .ok_or_else(|| LinkerError::InvalidInputType(path.clone()))?; diff --git a/src/llvm/message.rs b/src/llvm/message.rs index 662dea66..21971aa8 100644 --- a/src/llvm/message.rs +++ b/src/llvm/message.rs @@ -42,7 +42,7 @@ impl fmt::Display for Message { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { if !self.is_empty() { let contents = unsafe { CStr::from_ptr(self.ptr).to_str().unwrap() }; - write!(f, "{}", contents) + write!(f, "{contents}") } else { write!(f, "(empty)") }