Skip to content

Commit

Permalink
Merge pull request #684 from epage/kstring
Browse files Browse the repository at this point in the history
fix(edit): Use kstring when perf is enabled
  • Loading branch information
epage committed Feb 12, 2024
2 parents 27108d5 + 595e0c7 commit 7ad85b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

8 changes: 4 additions & 4 deletions crates/toml_edit/src/internal_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ use std::str::FromStr;
#[derive(Default, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct InternalString(Inner);

#[cfg(feature = "kstring")]
#[cfg(feature = "perf")]
type Inner = kstring::KString;
#[cfg(not(feature = "kstring"))]
#[cfg(not(feature = "perf"))]
type Inner = String;

impl InternalString {
Expand Down Expand Up @@ -56,9 +56,9 @@ impl AsRef<str> for InternalString {
impl From<&str> for InternalString {
#[inline]
fn from(s: &str) -> Self {
#[cfg(feature = "kstring")]
#[cfg(feature = "perf")]
let inner = kstring::KString::from_ref(s);
#[cfg(not(feature = "kstring"))]
#[cfg(not(feature = "perf"))]
let inner = String::from(s);

InternalString(inner)
Expand Down

0 comments on commit 7ad85b6

Please sign in to comment.