]> Repositorios git - scryer-prolog.git/commitdiff
stub a clippy config
authorSkgland <[email protected]>
Tue, 18 Nov 2025 21:13:18 +0000 (22:13 +0100)
committerBennet Bleßmann <[email protected]>
Wed, 19 Nov 2025 18:23:42 +0000 (19:23 +0100)
with things we need to get rid of replace if we want to eliminate panics due to oom

clippy.toml [new file with mode: 0644]

diff --git a/clippy.toml b/clippy.toml
new file mode 100644 (file)
index 0000000..523192f
--- /dev/null
@@ -0,0 +1,26 @@
+disallowed-macros = [
+    # https://rust-lang.github.io/rust-clippy/master/#disallowed_macros
+
+    # list of macros that may panic on allocation failure e.g.
+
+    # "std::vec",
+]
+
+disallowed-methods = [
+    # https://rust-lang.github.io/rust-clippy/master/#disallowed_method
+
+    # list of methods that may panic on allocation failue 
+    # though not including things that can be used correctly by reversing ahead of time (i.e. std::vec::Vec::try_reserve + std::iter::Extend::extend ).
+
+    # "std::iter::Iter::collect",
+    # { path = "std::vec::Vec::with_capacity", replacement = "std::vec::Vec::new + std::vec::Vec::try_reserve" },
+    # { path = "std::string::String::with_capacity", replacement = "std::string::String::new + std::string::String::try_reserve" },
+]
+
+disallowed-types = [
+    # https://rust-lang.github.io/rust-clippy/master/#disallowed_types
+
+    # list of types that can't be used without risking a panic due to allocation failure  
+
+    # { path = "std::collections::BTreeMap", reason = "unlike Vec and HashMap BTreeMap cannot reserve capacity ahead of time (i.e. try_reserve) making it unusable without risk of oom panic"},
+]