Skip to content

Commit b43af16

Browse files
authored
Merge pull request #257 from calcit-lang/trivial
handle trivial warnings
2 parents 8653149 + 4c9cdd4 commit b43af16

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

src/bin/calcit_deps.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ pub fn main() -> Result<(), String> {
7070
if version != CALCIT_VERSION {
7171
eprintln!(
7272
"[Warn] calcit version mismatch, deps.cirru expected {}, running {}",
73-
CALCIT_VERSION, version
73+
version, CALCIT_VERSION,
7474
);
7575
}
7676
}

src/builtins/refs.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ use crate::{call_stack::CallStackList, runner};
1313

1414
pub(crate) type ValueAndListeners = (Calcit, HashMap<EdnTag, Calcit>);
1515

16-
static REFS_DICT: LazyLock<Mutex<HashMap<Arc<str>, Arc<Mutex<ValueAndListeners>>>>> = LazyLock::new(|| Mutex::new(HashMap::new()));
16+
type RefListeners = HashMap<Arc<str>, Arc<Mutex<ValueAndListeners>>>;
17+
18+
static REFS_DICT: LazyLock<Mutex<RefListeners>> = LazyLock::new(|| Mutex::new(HashMap::new()));
1719

1820
fn modify_ref(locked_pair: Arc<Mutex<ValueAndListeners>>, v: Calcit, call_stack: &CallStackList) -> Result<(), CalcitErr> {
1921
let (listeners, prev) = {

src/program/entry_book.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,8 @@ where
140140
pub fn to_hashmap(&self) -> std::collections::HashMap<Arc<str>, T> {
141141
let mut res = std::collections::HashMap::with_capacity(self.0.len());
142142
for piece in &self.0 {
143-
match &piece.value {
144-
Some(v) => {
145-
res.insert(piece.key.to_owned(), v.to_owned());
146-
}
147-
None => {}
143+
if let Some(v) = &piece.value {
144+
res.insert(piece.key.to_owned(), v.to_owned());
148145
}
149146
}
150147
res

0 commit comments

Comments
 (0)