Skip to content
Merged
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
14 changes: 7 additions & 7 deletions lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
//! [`WindowsResource::compile()`]: struct.WindowsResource.html#method.compile
//! [`WindowsResource::new()`]: struct.WindowsResource.html#method.new

use std::collections::HashMap;
use std::collections::BTreeMap;
use std::env;
use std::fs;
use std::io;
Expand All @@ -57,7 +57,7 @@ use std::process;
extern crate toml;

/// Version info field names
#[derive(PartialEq, Eq, Hash, Debug)]
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
pub enum VersionInfo {
/// The version value consists of four 16 bit words, e.g.,
/// `MAJOR << 48 | MINOR << 32 | PATCH << 16 | RELEASE`
Expand Down Expand Up @@ -87,8 +87,8 @@ struct Icon {
#[derive(Debug)]
pub struct WindowsResource {
toolkit_path: PathBuf,
properties: HashMap<String, String>,
version_info: HashMap<VersionInfo, u64>,
properties: BTreeMap<String, String>,
version_info: BTreeMap<VersionInfo, u64>,
rc_file: Option<String>,
icons: Vec<Icon>,
language: u16,
Expand Down Expand Up @@ -147,8 +147,8 @@ impl WindowsResource {
/// | `FILEFLAGS` | `0x0` |
///
pub fn new() -> Self {
let mut props: HashMap<String, String> = HashMap::new();
let mut ver: HashMap<VersionInfo, u64> = HashMap::new();
let mut props: BTreeMap<String, String> = BTreeMap::new();
let mut ver: BTreeMap<VersionInfo, u64> = BTreeMap::new();

props.insert(
"FileVersion".to_string(),
Expand Down Expand Up @@ -843,7 +843,7 @@ fn get_sdk() -> io::Result<Vec<PathBuf>> {
}

#[cfg(feature = "toml")]
fn parse_cargo_toml(props: &mut HashMap<String, String>) -> io::Result<()> {
fn parse_cargo_toml(props: &mut BTreeMap<String, String>) -> io::Result<()> {
let cargo = Path::new(&env::var("CARGO_MANIFEST_DIR").unwrap()).join("Cargo.toml");
let mut f = fs::File::open(cargo)?;
let mut cargo_toml = String::new();
Expand Down