File tree Expand file tree Collapse file tree 4 files changed +19
-6
lines changed Expand file tree Collapse file tree 4 files changed +19
-6
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,22 @@ With print statement output.
103
103
cargo test -- --nocapture
104
104
```
105
105
106
+ #### Run Cargo fmt
107
+ Run fmt to catch formatting errors.
108
+
109
+ ```
110
+ rustup component add rustfmt
111
+ cargo fmt --all -- --check
112
+ ```
113
+
114
+ #### Run Clippy
115
+ Run Clippy tests to catch common lints and mistakes.
116
+
117
+ ```
118
+ rustup component add clippy
119
+ cargo clippy --no-deps -- -D warnings
120
+ ```
121
+
106
122
#### Run Benchmark Tests
107
123
```
108
124
cargo bench
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ impl EmsgBox {
26
26
4 + // id
27
27
Self :: time_size ( version) +
28
28
( scheme_id_uri. len ( ) + 1 ) as u64 +
29
- ( value. len ( ) as u64 + 1 ) as u64
29
+ ( value. len ( ) as u64 + 1 )
30
30
}
31
31
32
32
fn time_size ( version : u8 ) -> u64 {
Original file line number Diff line number Diff line change @@ -17,10 +17,7 @@ impl<R: Read + Seek> ReadBox<&mut R> for MetaBox {
17
17
18
18
let ( version, _) = read_box_header_ext ( reader) ?;
19
19
if version != 0 {
20
- return Err ( Error :: UnsupportedBoxVersion (
21
- BoxType :: UdtaBox ,
22
- version as u8 ,
23
- ) ) ;
20
+ return Err ( Error :: UnsupportedBoxVersion ( BoxType :: UdtaBox , version) ) ;
24
21
}
25
22
26
23
let mut ilst = None ;
Original file line number Diff line number Diff line change @@ -427,7 +427,7 @@ impl Mp4Track {
427
427
fn sample_offset ( & self , sample_id : u32 ) -> Result < u64 > {
428
428
if !self . trafs . is_empty ( ) {
429
429
if let Some ( ( traf_idx, _sample_idx) ) = self . find_traf_idx_and_sample_idx ( sample_id) {
430
- Ok ( self . trafs [ traf_idx] . tfhd . base_data_offset as u64 )
430
+ Ok ( self . trafs [ traf_idx] . tfhd . base_data_offset )
431
431
} else {
432
432
Err ( Error :: BoxInTrafNotFound ( self . track_id ( ) , BoxType :: TrafBox ) )
433
433
}
You can’t perform that action at this time.
0 commit comments