//! # Examples
//!
//! ```no_run
-//! use nihav_core::detect::detect_format;
+//! use nihav_registry::detect::detect_format;
//! use std::fs::File;
//! use nihav_core::io::byteio::*;
//!
}
}
fn eq(&self, src: &mut ByteReader) -> bool {
- let val = self.read_val(src);
- if val.is_none() { false }
- else { val.unwrap() == self.val() }
+ if let Some(rval) = self.read_val(src) {
+ rval == self.val()
+ } else {
+ false
+ }
}
fn ge(&self, src: &mut ByteReader) -> bool {
- let val = self.read_val(src);
- if val.is_none() { false }
- else { val.unwrap() >= self.val() }
+ if let Some(rval) = self.read_val(src) {
+ rval >= self.val()
+ } else {
+ false
+ }
}
fn gt(&self, src: &mut ByteReader) -> bool {
- let val = self.read_val(src);
- if val.is_none() { false }
- else { val.unwrap() > self.val() }
+ if let Some(rval) = self.read_val(src) {
+ rval > self.val()
+ } else {
+ false
+ }
}
fn le(&self, src: &mut ByteReader) -> bool {
- let val = self.read_val(src);
- if val.is_none() { false }
- else { val.unwrap() <= self.val() }
+ if let Some(rval) = self.read_val(src) {
+ rval <= self.val()
+ } else {
+ false
+ }
}
fn lt(&self, src: &mut ByteReader) -> bool {
- let val = self.read_val(src);
- if val.is_none() { false }
- else { val.unwrap() < self.val() }
+ if let Some(rval) = self.read_val(src) {
+ rval < self.val()
+ } else {
+ false
+ }
}
}
mod test {
use super::*;
use std::fs::File;
- use crate::io::byteio::*;
+ use nihav_core::io::byteio::*;
#[test]
fn test_avi_detect() {