Skip to content

Commit

Permalink
clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jessekrubin committed Dec 18, 2024
1 parent ce83d10 commit 6046f6c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@
## FUTURE

- `python -m ry.dev` repl for ipython/python repl ~ handy nifty secret tool makes it into repo
- internal
- in process of renaming all python-rust `#[new]` functions to be named `fn py_new(...)`
- `unindent`
- Added `unindent` module for unindenting strings will move to `ryo3-unindent`
- `FsPath`
- creeping ever closer to being a full-fledged pathlib.Path replacement
- Added bindings to all rust `std::path::Path(buf)` methods for `FsPath`
- sub-packaging
- `xxhash` is own sub package now `ry.xxhash`
- food-for-thought-ing how `ryo3` and `ry` should be organized w/ respsect to sub-packages and where that organization should be
- type-annotations
- required to break up the type annotations due to migration to sub-packages
- breaking up the type annotations file into smaller files under `<REPO>/python/ry/ryo3/*.pyi`

___

Expand Down
11 changes: 6 additions & 5 deletions crates/ryo3-sqlformat/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use pyo3::prelude::PyModule;
use pyo3::prelude::*;
use sqlformat::{self, QueryParams};
use std::collections::{BTreeMap, HashMap};
use std::collections::HashMap;
use std::hash::{Hash, Hasher};

#[pyclass(name = "SqlfmtQueryParams", module = "ryo3")]
Expand Down Expand Up @@ -74,10 +74,11 @@ impl PySqlfmtQueryParams {
// make 2 vecccccs o refs...
let mut p1: Vec<(&str, &str)> =
p1.iter().map(|(k, v)| (k.as_str(), v.as_str())).collect();
p1.sort();
p1.sort_by(|a, b| a.0.cmp(b.0));

let mut p2: Vec<(&str, &str)> =
p2.iter().map(|(k, v)| (k.as_str(), v.as_str())).collect();
p2.sort();
p2.sort_by(|a, b| a.0.cmp(b.0));
p1 == p2
}
(QueryParams::Indexed(p1), QueryParams::Indexed(p2)) => p1 == p2,
Expand All @@ -96,14 +97,14 @@ impl PySqlfmtQueryParams {
QueryParams::Named(p) => {
let mut p: Vec<(&str, &str)> =
p.iter().map(|(k, v)| (k.as_str(), v.as_str())).collect();
p.sort();
p.sort_by(|a, b| a.0.cmp(b.0));
for (k, v) in p {
k.hash(&mut hasher);
v.hash(&mut hasher);
}
}
QueryParams::Indexed(p) => {
for v in p.iter() {
for v in p {
v.hash(&mut hasher);
}
}
Expand Down

0 comments on commit 6046f6c

Please sign in to comment.