Skip to content

Commit

Permalink
schema: impl DerefMut for Types
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Mar 26, 2024
1 parent 94f8691 commit e04cfff
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/schema/script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
//! Components related to the scripting system used by schema or applied at the
//! specific contract operation level
use std::ops::Deref;
use std::ops::{Deref, DerefMut};

use strict_types::TypeSystem;

Expand Down Expand Up @@ -101,6 +101,14 @@ impl Deref for Types {
}
}

impl DerefMut for Types {
fn deref_mut(&mut self) -> &mut Self::Target {
match self {
Types::Strict(sys) => sys,
}
}
}

impl Default for Types {
fn default() -> Self { Types::Strict(none!()) }
}
Expand Down

0 comments on commit e04cfff

Please sign in to comment.