[oden] Remove magic
This commit is contained in:
parent
e36ab17235
commit
fd7e19e529
1 changed files with 1 additions and 9 deletions
|
|
@ -16,23 +16,16 @@ pub enum GraphicsCommand {
|
|||
EndFrame,
|
||||
}
|
||||
|
||||
const MAGIC_VALUE: u64 = 0xABCDB00BABCDBEEB;
|
||||
|
||||
struct GraphicsImpl {
|
||||
magic: u64,
|
||||
sender: Sender<GraphicsCommand>,
|
||||
}
|
||||
|
||||
impl GraphicsImpl {
|
||||
pub fn new(sender: Sender<GraphicsCommand>) -> Self {
|
||||
GraphicsImpl {
|
||||
magic: MAGIC_VALUE,
|
||||
sender,
|
||||
}
|
||||
GraphicsImpl { sender }
|
||||
}
|
||||
|
||||
fn print_fn(&self, ctx: &ContextRef, args: &[&ValueRef]) -> ValueResult {
|
||||
assert_eq!(self.magic, MAGIC_VALUE);
|
||||
let mut text = String::with_capacity(128);
|
||||
for arg in args {
|
||||
let v = arg.to_string(ctx)?;
|
||||
|
|
@ -47,7 +40,6 @@ impl GraphicsImpl {
|
|||
}
|
||||
|
||||
fn cls_fn(&self, ctx: &ContextRef, args: &[&ValueRef]) -> ValueResult {
|
||||
assert_eq!(self.magic, MAGIC_VALUE);
|
||||
if args.len() != 3 {
|
||||
return Err(Error::ArgumentCountMismatch {
|
||||
expected: 3,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue