Skip to content
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
4 changes: 3 additions & 1 deletion crates/hotfix-dictionary/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ keywords.workspace = true
categories.workspace = true

[features]
default = ["smartstring"]
fix40 = []
fix41 = []
fix42 = []
Expand All @@ -21,13 +22,14 @@ fix50 = []
fix50sp1 = []
fix50sp2 = []
fixt11 = []
smartstring = ["dep:smartstring"]

[lints]
workspace = true

[dependencies]
fnv.workspace = true
roxmltree.workspace = true
smartstring.workspace = true
smartstring = { workspace = true, optional = true }
strum.workspace = true
strum_macros.workspace = true
3 changes: 1 addition & 2 deletions crates/hotfix-dictionary/src/component.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use smartstring::alias::String as SmartString;

use crate::string::SmartString;
use crate::{Dictionary, Field, LayoutItem, LayoutItemData, LayoutItemKind};

/// A [`Component`] is an ordered collection of fields and/or other components.
Expand Down
2 changes: 1 addition & 1 deletion crates/hotfix-dictionary/src/dictionary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use crate::{Component, ComponentData, Datatype, DatatypeData, Field, FieldData};

use crate::message_definition::{MessageData, MessageDefinition};
use crate::quickfix::{ParseDictionaryError, QuickFixReader};
use crate::string::SmartString;
use fnv::FnvHashMap;
use smartstring::alias::String as SmartString;

/// Specifies business semantics for application-level entities within the FIX
/// Protocol.
Expand Down
2 changes: 1 addition & 1 deletion crates/hotfix-dictionary/src/field.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::string::SmartString;
use crate::{Datatype, Dictionary, FixDatatype, TagU32};
use smartstring::alias::String as SmartString;

pub trait IsFieldDefinition {
/// Returns the FIX tag associated with `self`.
Expand Down
2 changes: 1 addition & 1 deletion crates/hotfix-dictionary/src/layout.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use smartstring::alias::String as SmartString;
use std::fmt;

use crate::component::Component;
use crate::string::SmartString;
use crate::{Dictionary, Field};

pub fn display_layout_item(indent: u32, item: LayoutItem, f: &mut fmt::Formatter) -> fmt::Result {
Expand Down
1 change: 1 addition & 0 deletions crates/hotfix-dictionary/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ mod field;
mod layout;
mod message_definition;
mod quickfix;
mod string;

use component::{Component, ComponentData};
use datatype::DatatypeData;
Expand Down
2 changes: 1 addition & 1 deletion crates/hotfix-dictionary/src/message_definition.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::string::SmartString;
use crate::{Dictionary, LayoutItem, LayoutItems};
use smartstring::alias::String as SmartString;

#[derive(Clone, Debug)]
pub struct MessageData {
Expand Down
3 changes: 1 addition & 2 deletions crates/hotfix-dictionary/src/quickfix.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use smartstring::alias::String as SmartString;

use crate::builder::DictionaryBuilder;
use crate::component::{ComponentData, FixmlComponentAttributes};
use crate::message_definition::MessageData;
use crate::string::SmartString;
use crate::{
DatatypeData, Dictionary, FieldData, FieldEnumData, FixDatatype, LayoutItemData,
LayoutItemKindData, LayoutItems,
Expand Down
4 changes: 4 additions & 0 deletions crates/hotfix-dictionary/src/string.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#[cfg(feature = "smartstring")]
pub(crate) use smartstring::alias::String as SmartString;
#[cfg(not(feature = "smartstring"))]
pub(crate) use std::string::String as SmartString;