diff --git a/CHANGELOG.md b/CHANGELOG.md index 92d71e1..4a485cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 `/python/ry/ryo3/*.pyi` ___ diff --git a/crates/ryo3-sqlformat/src/lib.rs b/crates/ryo3-sqlformat/src/lib.rs index c842274..30532d9 100644 --- a/crates/ryo3-sqlformat/src/lib.rs +++ b/crates/ryo3-sqlformat/src/lib.rs @@ -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")] @@ -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, @@ -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); } }