Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup empty/unused files + lints #500

Merged
merged 4 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sdk/src/assertions/exif.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl Exif {
v.push(value);
self
}
None => self.insert(&key, &Vec::from([value]))?,
None => self.insert(&key, Vec::from([value]))?,
})
}

Expand Down
2 changes: 1 addition & 1 deletion sdk/src/assertions/schema_org.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ impl SchemaDotOrg {
v.push(value);
self
}
None => self.insert(key, &Vec::from([value]))?,
None => self.insert(key, Vec::from([value]))?,
})
}

Expand Down
6 changes: 1 addition & 5 deletions sdk/src/asset_handlers/bmff_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -510,11 +510,7 @@ where
let desired_flags = u32::from_be_bytes(temp_bytes);

if let Some(box_flags) = box_info.flags {
let exact = if let Some(is_exact) = bmff_exclusion.exact {
is_exact
} else {
true
};
let exact = bmff_exclusion.exact.unwrap_or(true);

if exact {
if desired_flags != box_flags {
Expand Down
6 changes: 3 additions & 3 deletions sdk/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ impl Builder {
stream.read_to_end(&mut resource)?;
// add the resource and set the resource reference
self.resources
.add(&self.definition.instance_id.clone(), resource)?;
.add(self.definition.instance_id.clone(), resource)?;
self.definition.thumbnail = Some(ResourceRef::new(
format,
self.definition.instance_id.clone(),
Expand Down Expand Up @@ -686,7 +686,7 @@ impl Builder {
{
stream.rewind()?;
self.resources
.add(&self.definition.instance_id.clone(), image)?;
.add(self.definition.instance_id.clone(), image)?;
self.definition.thumbnail = Some(ResourceRef::new(
format,
self.definition.instance_id.clone(),
Expand Down Expand Up @@ -1114,7 +1114,7 @@ mod tests {

let mut builder = Builder::from_json(&manifest_json()).unwrap();
builder
.add_ingredient(&parent_json(), format, &mut source)
.add_ingredient(parent_json(), format, &mut source)
.unwrap();

builder
Expand Down
63 changes: 0 additions & 63 deletions sdk/src/embedded_xmp.rs

This file was deleted.

6 changes: 1 addition & 5 deletions sdk/src/jumbf/boxes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1728,11 +1728,7 @@ impl JUMBFEmbeddedFileDescriptionBox {
.position(|&c| c == b'\0')
.unwrap_or(bytes.len());

if let Ok(r_str) = String::from_utf8(bytes[0..nul_range_end].to_vec()) {
r_str
} else {
String::new()
}
String::from_utf8(bytes[0..nul_range_end].to_vec()).unwrap_or_default()
}

pub fn media_type(&self) -> String {
Expand Down
1 change: 0 additions & 1 deletion sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
// specific language governing permissions and limitations under
// each license.

#![deny(warnings)]
#![deny(clippy::expect_used)]
#![deny(clippy::panic)]
#![deny(clippy::unwrap_used)]
Expand Down
1 change: 0 additions & 1 deletion sdk/src/manifest2.rs

This file was deleted.

4 changes: 2 additions & 2 deletions sdk/src/resource_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,10 +442,10 @@ mod tests {

let mut builder = Builder::from_json(json).expect("from json");
builder
.add_resource("abc123", &mut Cursor::new(value))
.add_resource("abc123", Cursor::new(value))
.expect("add_resource");
builder
.add_resource("cba321", &mut Cursor::new(value))
.add_resource("cba321", Cursor::new(value))
.expect("add_resource");

let image = include_bytes!("../tests/fixtures/earth_apollo17.jpg");
Expand Down
Loading