Skip to content

Commit fe7ad78

Browse files
committed
chore(clippy): make clippy happy
1 parent 72be631 commit fe7ad78

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

.github/workflows/rust.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
uses: actions/checkout@v6
1818
- name: Install Toolchain
1919
run: rustup update stable && rustup default stable
20+
- uses: taiki-e/install-action@sccache
21+
- uses: taiki-e/install-action@nextest
2022
- name: Run tests
2123
run: cargo nextest run --release --all-features
2224
check:
@@ -26,6 +28,7 @@ jobs:
2628
uses: actions/checkout@v6
2729
- name: Install Toolchain
2830
run: rustup update stable && rustup default stable
31+
- uses: taiki-e/install-action@sccache
2932
- name: Run format check
3033
run: cargo fmt --check
3134
- name: Run clippy

src/pym.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ use std::ffi::CString;
77

88
/// Exec python scripts as filter
99
pub fn exec(module: &str) -> Result<Vec<String>> {
10-
pyo3::prepare_freethreaded_python();
11-
let script = load_script(&module)?;
10+
Python::initialize();
11+
let script = load_script(module)?;
1212
let cache = Cache::new()?;
1313

1414
// args
1515
let sps = serde_json::to_string(&cache.get_problems()?)?;
1616
let stags = serde_json::to_string(&cache.get_tags()?)?;
1717

1818
// pygil
19-
Python::with_gil(|py| {
19+
Python::attach(|py| {
2020
let script_cstr = CString::new(script.as_str())?;
2121
let filename_cstr = CString::new("plan.py")?;
2222
let module_name_cstr = CString::new("plan")?;

0 commit comments

Comments
 (0)