From 954ea94bb2c2c83d5bd5abae436686fd085d090b Mon Sep 17 00:00:00 2001
From: Savanni D'Gerinel <savanni@luminescent-dreams.com>
Date: Sat, 31 Dec 2022 12:39:11 -0500
Subject: [PATCH] Set up build infrastructure for fluent-ergonomics

---
 fluent-ergonomics/.envrc     |  1 -
 fluent-ergonomics/.gitignore |  2 -
 fluent-ergonomics/Cargo.lock |  4 +-
 fluent-ergonomics/Cargo.toml |  2 +-
 fluent-ergonomics/Makefile   |  9 +++++
 fluent-ergonomics/flake.lock | 73 ------------------------------------
 fluent-ergonomics/flake.nix  | 30 ---------------
 fluent-ergonomics/src/lib.rs |  4 +-
 8 files changed, 14 insertions(+), 111 deletions(-)
 delete mode 100644 fluent-ergonomics/.envrc
 delete mode 100644 fluent-ergonomics/.gitignore
 create mode 100644 fluent-ergonomics/Makefile
 delete mode 100644 fluent-ergonomics/flake.lock
 delete mode 100644 fluent-ergonomics/flake.nix

diff --git a/fluent-ergonomics/.envrc b/fluent-ergonomics/.envrc
deleted file mode 100644
index 3550a30..0000000
--- a/fluent-ergonomics/.envrc
+++ /dev/null
@@ -1 +0,0 @@
-use flake
diff --git a/fluent-ergonomics/.gitignore b/fluent-ergonomics/.gitignore
deleted file mode 100644
index 75e92a9..0000000
--- a/fluent-ergonomics/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-target
-.direnv
diff --git a/fluent-ergonomics/Cargo.lock b/fluent-ergonomics/Cargo.lock
index e785058..efaa205 100644
--- a/fluent-ergonomics/Cargo.lock
+++ b/fluent-ergonomics/Cargo.lock
@@ -4,9 +4,9 @@ version = 3
 
 [[package]]
 name = "fluent"
-version = "0.15.0"
+version = "0.16.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bc4d7142005e2066e4844caf9f271b93fc79836ee96ec85057b8c109687e629a"
+checksum = "61f69378194459db76abd2ce3952b790db103ceb003008d3d50d97c41ff847a7"
 dependencies = [
  "fluent-bundle",
  "unic-langid",
diff --git a/fluent-ergonomics/Cargo.toml b/fluent-ergonomics/Cargo.toml
index ddf281b..5d4a0e3 100644
--- a/fluent-ergonomics/Cargo.toml
+++ b/fluent-ergonomics/Cargo.toml
@@ -18,6 +18,6 @@ include = [
 ]
 
 [dependencies]
-fluent = "0.15"
+fluent = "0.16"
 unic-langid = "0.9"
 fluent-syntax = "0.11"
diff --git a/fluent-ergonomics/Makefile b/fluent-ergonomics/Makefile
new file mode 100644
index 0000000..1bd40ea
--- /dev/null
+++ b/fluent-ergonomics/Makefile
@@ -0,0 +1,9 @@
+
+dev:
+	cargo watch -x build
+
+test:
+	cargo watch -x test
+
+test-once:
+	cargo test
diff --git a/fluent-ergonomics/flake.lock b/fluent-ergonomics/flake.lock
deleted file mode 100644
index 97e7bf5..0000000
--- a/fluent-ergonomics/flake.lock
+++ /dev/null
@@ -1,73 +0,0 @@
-{
-  "nodes": {
-    "flake-utils": {
-      "locked": {
-        "lastModified": 1637014545,
-        "narHash": "sha256-26IZAc5yzlD9FlDT54io1oqG/bBoyka+FJk5guaX4x4=",
-        "owner": "numtide",
-        "repo": "flake-utils",
-        "rev": "bba5dcc8e0b20ab664967ad83d24d64cb64ec4f4",
-        "type": "github"
-      },
-      "original": {
-        "owner": "numtide",
-        "repo": "flake-utils",
-        "type": "github"
-      }
-    },
-    "nixpkgs": {
-      "locked": {
-        "lastModified": 1650400979,
-        "narHash": "sha256-OjWH2+HyxOwiO2jP01E1QH06gArw+zLWbCQMgEve9gg=",
-        "owner": "NixOS",
-        "repo": "nixpkgs",
-        "rev": "147b03fa8ebf9d5d5f6784f87dc61f0e7beee911",
-        "type": "github"
-      },
-      "original": {
-        "id": "nixpkgs",
-        "ref": "nixos-21.11",
-        "type": "indirect"
-      }
-    },
-    "nixpkgs_2": {
-      "locked": {
-        "lastModified": 1637453606,
-        "narHash": "sha256-Gy6cwUswft9xqsjWxFYEnx/63/qzaFUwatcbV5GF/GQ=",
-        "owner": "NixOS",
-        "repo": "nixpkgs",
-        "rev": "8afc4e543663ca0a6a4f496262cd05233737e732",
-        "type": "github"
-      },
-      "original": {
-        "owner": "NixOS",
-        "ref": "nixpkgs-unstable",
-        "repo": "nixpkgs",
-        "type": "github"
-      }
-    },
-    "oxalica": {
-      "inputs": {
-        "flake-utils": "flake-utils",
-        "nixpkgs": "nixpkgs_2"
-      },
-      "locked": {
-        "narHash": "sha256-lW3mZGsH0WYPI+zr/CzbDoWvRliYEHDT906yRx6NboY=",
-        "type": "tarball",
-        "url": "https://github.com/oxalica/rust-overlay/archive/master.tar.gz"
-      },
-      "original": {
-        "type": "tarball",
-        "url": "https://github.com/oxalica/rust-overlay/archive/master.tar.gz"
-      }
-    },
-    "root": {
-      "inputs": {
-        "nixpkgs": "nixpkgs",
-        "oxalica": "oxalica"
-      }
-    }
-  },
-  "root": "root",
-  "version": 7
-}
diff --git a/fluent-ergonomics/flake.nix b/fluent-ergonomics/flake.nix
deleted file mode 100644
index 969b04b..0000000
--- a/fluent-ergonomics/flake.nix
+++ /dev/null
@@ -1,30 +0,0 @@
-{
-  description = "fluent-ergonomics";
-
-  inputs = {
-    nixpkgs.url = "nixpkgs/nixos-21.11";
-    oxalica.url = "https://github.com/oxalica/rust-overlay/archive/master.tar.gz";
-  };
-
-  outputs = { self, nixpkgs, oxalica }:
-    let 
-      version = builtins.string 0 8 self.lastModifiedDate;
-      supportedSystems = [ "x86_64-linux" ];
-    in
-    {
-      devShell."x86_64-linux" =
-        let
-          rust_overlay = import oxalica;
-          pkgs = import nixpkgs { system = "x86_64-linux"; overlays = [ rust_overlay ]; };
-          rust = pkgs.rust-bin.stable."1.59.0".default.override {
-            extensions = [ "rust-src" ];
-          };
-        in
-        pkgs.mkShell {
-          name = "fluent-ergonomics";
-          buildInputs = [
-            rust
-          ];
-        };
-    };
-}
diff --git a/fluent-ergonomics/src/lib.rs b/fluent-ergonomics/src/lib.rs
index 3426b6b..e41c375 100644
--- a/fluent-ergonomics/src/lib.rs
+++ b/fluent-ergonomics/src/lib.rs
@@ -331,7 +331,7 @@ history = Historio
             .add_from_text(en_id, String::from(EN_TRANSLATIONS))
             .expect("text should load");
         let mut args = FluentArgs::new();
-        args.insert("time", FluentValue::from(String::from("13:00")));
+        args.set("time", FluentValue::from(String::from("13:00")));
         assert_eq!(
             fluent.tr("time_display", Some(&args)).unwrap(),
             String::from("13:00 during the day")
@@ -346,7 +346,7 @@ history = Historio
             .add_from_text(en_id, String::from(EN_TRANSLATIONS))
             .expect("text should load");
         let mut args = FluentArgs::new();
-        args.insert("time", FluentValue::from(String::from("13:00")));
+        args.set("time", FluentValue::from(String::from("13:00")));
         assert_eq!(
             fluent.tr("nested_display", Some(&args)).unwrap(),
             String::from("nesting a time display: 13:00 during the day")