Drop flagset crate in favor of enumset.
authorBen Pfaff <blp@cs.stanford.edu>
Sat, 11 Oct 2025 05:11:08 +0000 (22:11 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Sat, 11 Oct 2025 05:11:08 +0000 (22:11 -0700)
rust/Cargo.lock
rust/pspp/Cargo.toml
rust/pspp/src/command.rs
rust/pspp/src/command/crosstabs.rs
rust/pspp/src/command/ctables.rs
rust/pspp/src/command/data_list.rs
rust/pspp/src/command/descriptives.rs

index 814831bacff97c662d54a39df1c159a0f7eea148..ca955f116f0f7479b2e4e33c3f6ba2dfb0753706 100644 (file)
@@ -782,12 +782,6 @@ dependencies = [
  "windows-sys 0.59.0",
 ]
 
-[[package]]
-name = "flagset"
-version = "0.4.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b7ac824320a75a52197e8f2d787f6a38b6718bb6897a35142d749af3c0e8f4fe"
-
 [[package]]
 name = "flate2"
 version = "1.1.1"
@@ -1878,7 +1872,6 @@ dependencies = [
  "enum-iterator",
  "enum-map",
  "enumset",
- "flagset",
  "flate2",
  "hashbrown 0.15.5",
  "hexplay",
index 60337e1db77c76a45882fa4e9ed0537f51fa686c..1f60f971cfbf00cbd2b08a7ceac5d743e50cdcfc 100644 (file)
@@ -22,7 +22,6 @@ indexmap = { version = "2.1.0", features = ["serde"] }
 unicode-width = "0.2.0"
 chardetng = "0.1.17"
 enum-map = { version = "2.7.3", features = ["serde"] }
-flagset = "0.4.6"
 pspp-derive = { version = "0.1.0", path = "../pspp-derive" }
 either = "1.13.0"
 enum-iterator = "2.1.0"
index 471bb84485659e66afc1de75f4a7b012c13ea899..78f88f708b8422ebecc9d73da75af0342705e8bb 100644 (file)
@@ -26,7 +26,7 @@ use ctables::ctables_command;
 use data_list::data_list_command;
 use descriptives::descriptives_command;
 use either::Either;
-use flagset::{FlagSet, flags};
+use enumset::{EnumSet, EnumSetType};
 use pspp_derive::FromTokens;
 
 use crate::{
@@ -46,30 +46,29 @@ pub mod ctables;
 pub mod data_list;
 pub mod descriptives;
 
-flags! {
-    enum State: u8 {
-        /// No active dataset yet defined.
-        Initial,
+#[derive(Debug, EnumSetType)]
+enum State {
+    /// No active dataset yet defined.
+    Initial,
 
-        /// Active dataset has been defined.
-        Data,
+    /// Active dataset has been defined.
+    Data,
 
-        /// Inside `INPUT PROGRAM`.
-        InputProgram,
+    /// Inside `INPUT PROGRAM`.
+    InputProgram,
 
-        /// Inside `FILE TYPE`.
-        FileType,
+    /// Inside `FILE TYPE`.
+    FileType,
 
-        /// State nested inside `LOOP` or `DO IF`, inside [State::Data].
-        NestedData,
+    /// State nested inside `LOOP` or `DO IF`, inside [State::Data].
+    NestedData,
 
-        /// State nested inside `LOOP` or `DO IF`, inside [State::InputProgram].
-        NestedInputProgram,
-    }
+    /// State nested inside `LOOP` or `DO IF`, inside [State::InputProgram].
+    NestedInputProgram,
 }
 
 struct Command {
-    allowed_states: FlagSet<State>,
+    allowed_states: EnumSet<State>,
     enhanced_only: bool,
     testing_only: bool,
     no_abbrev: bool,
@@ -817,7 +816,7 @@ fn commands() -> &'static [Command] {
             ctables_command(),
             data_list_command(),
             Command {
-                allowed_states: FlagSet::full(),
+                allowed_states: EnumSet::all(),
                 enhanced_only: false,
                 testing_only: false,
                 no_abbrev: false,
index 38079857b86f7719c35a60a6cfd0d3e81082cf3e..53344af1493cd64069d90a5b1e067695e84a65e8 100644 (file)
@@ -14,7 +14,7 @@
 // You should have received a copy of the GNU General Public License along with
 // this program.  If not, see <http://www.gnu.org/licenses/>.
 
-use flagset::FlagSet;
+use enumset::EnumSet;
 
 use super::{By, Comma, Command, Equals, Integer, Number, Punctuated, Subcommands, VarList};
 use crate::command::{
@@ -24,7 +24,7 @@ use crate::command::{
 
 pub(super) fn crosstabs_command() -> Command {
     Command {
-        allowed_states: FlagSet::full(),
+        allowed_states: EnumSet::all(),
         enhanced_only: false,
         testing_only: false,
         no_abbrev: false,
index a42e9fcd2d2b8c7acf435a3a10e8c1cba552ecfe..2556bdd8cc98d5c7357898613835fe6a4c839bec 100644 (file)
@@ -17,7 +17,7 @@
 use std::fmt::Debug;
 
 use either::Either;
-use flagset::FlagSet;
+use enumset::EnumSet;
 
 use super::{
     And, Asterisk, By, Command, Dash, Equals, Exp, Gt, InSquares, Integer, Number, Plus,
@@ -31,7 +31,7 @@ use crate::{
 
 pub(super) fn ctables_command() -> Command {
     Command {
-        allowed_states: FlagSet::full(),
+        allowed_states: EnumSet::all(),
         enhanced_only: false,
         testing_only: false,
         no_abbrev: false,
index ea52f708a671700b18b5f27afb1bca4594af9f7f..c5becd3657178ace6341ea3f49402fe5ef609a86 100644 (file)
@@ -15,7 +15,7 @@
 // this program.  If not, see <http://www.gnu.org/licenses/>.
 
 use either::Either;
-use flagset::FlagSet;
+use enumset::EnumSet;
 
 use super::{Comma, Command, Equals, Integer, Punctuated, Seq0, Seq1, Slash};
 use crate::{
@@ -25,7 +25,7 @@ use crate::{
 
 pub(super) fn data_list_command() -> Command {
     Command {
-        allowed_states: FlagSet::full(),
+        allowed_states: EnumSet::all(),
         enhanced_only: false,
         testing_only: false,
         no_abbrev: false,
index 9f8fb2d8b68b625d685c9360dbd9ab09c752d36f..656274dffab301ae5c816c00a18415e716a053be 100644 (file)
@@ -14,7 +14,7 @@
 // You should have received a copy of the GNU General Public License along with
 // this program.  If not, see <http://www.gnu.org/licenses/>.
 
-use flagset::FlagSet;
+use enumset::EnumSet;
 
 use super::{Comma, Command, Equals, Punctuated, Seq1, Subcommands};
 use crate::command::{
@@ -24,7 +24,7 @@ use crate::command::{
 
 pub(super) fn descriptives_command() -> Command {
     Command {
-        allowed_states: FlagSet::full(),
+        allowed_states: EnumSet::all(),
         enhanced_only: false,
         testing_only: false,
         no_abbrev: false,