Skip to content

Commit

Permalink
Replace unmaintained tempdir dep by tempfile
Browse files Browse the repository at this point in the history
  • Loading branch information
tux3 committed Jul 8, 2022
1 parent 0b1dd10 commit e85eab3
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 50 deletions.
80 changes: 34 additions & 46 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ description = "Tool to merge and control visibility of static libraries"
objpoke = "0.3"
structopt = "0.3"
ar = "0.9"
tempdir = "0.3.7"
tempfile = "3.3.0"
rand = "0.8"
object = "0.29"
goblin = "0.4"
Expand Down
6 changes: 4 additions & 2 deletions src/archives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use rand::thread_rng;
use std::fmt::{Debug, Formatter};
use std::fs::File;
use std::io::{Read, Write};
use tempdir::TempDir;
use tracing::info;

#[derive(Copy, Clone, Debug, Eq, PartialEq)]
Expand Down Expand Up @@ -54,7 +53,10 @@ fn archive_object_type(object_header: &[u8; 16]) -> ArchiveContents {
pub fn extract_objects<I: IntoIterator<Item = InputLibrary<R>>, R: Read>(
input_libraries: I,
) -> Result<ExtractedArchive, ProcessInputError> {
let dir = TempDir::new("armerge").map_err(ProcessInputError::TempDir)?;
let dir = tempfile::Builder::new()
.prefix("armerge.")
.tempdir()
.map_err(ProcessInputError::TempDir)?;
let mut objects = Vec::new();
let mut archive_contents = ArchiveContents::Empty;

Expand Down
2 changes: 1 addition & 1 deletion src/objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::{ArchiveContents, MergeError};
use regex::Regex;
use std::collections::HashMap;
use std::path::{Path, PathBuf};
use tempdir::TempDir;
use tempfile::TempDir;

pub struct ObjectTempDir {
pub dir: TempDir,
Expand Down

0 comments on commit e85eab3

Please sign in to comment.