Skip to content

Commit

Permalink
remove rubicon (merde has a single ABI now anyway)
Browse files Browse the repository at this point in the history
fasterthanlime committed Dec 4, 2024
1 parent 271b998 commit 7fd1cb6
Showing 4 changed files with 0 additions and 30 deletions.
7 changes: 0 additions & 7 deletions Cargo.lock

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

1 change: 0 additions & 1 deletion merde_core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -15,7 +15,6 @@ rust-version = "1.83"
compact_str = { version = "0.8.0" }
compact_bytes = { version = "0.1.3" }
ordered-float = "4.3.0"
rubicon = "3.4.9"
rusqlite = { version = "0.32.1", optional = true }
serde = { version = "1", optional = true }
time = { version = "0.3.36", optional = true, features = ["parsing", "formatting"] }
18 changes: 0 additions & 18 deletions merde_core/src/cowstr.rs
Original file line number Diff line number Diff line change
@@ -57,8 +57,6 @@ impl<'s> CowStr<'s> {
impl AsRef<str> for CowStr<'_> {
#[inline]
fn as_ref(&self) -> &str {
crate::compatibility_check_once();

match self {
CowStr::Borrowed(s) => s,
CowStr::Owned(s) => s.as_str(),
@@ -71,8 +69,6 @@ impl Deref for CowStr<'_> {

#[inline]
fn deref(&self) -> &Self::Target {
crate::compatibility_check_once();

match self {
CowStr::Borrowed(s) => s,
CowStr::Owned(s) => s.as_str(),
@@ -144,39 +140,34 @@ impl From<CowStr<'_>> for Box<str> {
impl<'a> PartialEq<CowStr<'a>> for CowStr<'_> {
#[inline]
fn eq(&self, other: &CowStr<'a>) -> bool {
crate::compatibility_check_once();
self.deref() == other.deref()
}
}

impl PartialEq<&str> for CowStr<'_> {
#[inline]
fn eq(&self, other: &&str) -> bool {
crate::compatibility_check_once();
self.deref() == *other
}
}

impl PartialEq<CowStr<'_>> for &str {
#[inline]
fn eq(&self, other: &CowStr<'_>) -> bool {
crate::compatibility_check_once();
*self == other.deref()
}
}

impl PartialEq<String> for CowStr<'_> {
#[inline]
fn eq(&self, other: &String) -> bool {
crate::compatibility_check_once();
self.deref() == other.as_str()
}
}

impl PartialEq<CowStr<'_>> for String {
#[inline]
fn eq(&self, other: &CowStr<'_>) -> bool {
crate::compatibility_check_once();
self.as_str() == other.deref()
}
}
@@ -186,23 +177,20 @@ impl Eq for CowStr<'_> {}
impl Hash for CowStr<'_> {
#[inline]
fn hash<H: Hasher>(&self, state: &mut H) {
crate::compatibility_check_once();
self.deref().hash(state)
}
}

impl fmt::Debug for CowStr<'_> {
#[inline]
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
crate::compatibility_check_once();
self.deref().fmt(f)
}
}

impl fmt::Display for CowStr<'_> {
#[inline]
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
crate::compatibility_check_once();
self.deref().fmt(f)
}
}
@@ -212,7 +200,6 @@ impl IntoStatic for CowStr<'_> {

#[inline]
fn into_static(self) -> Self::Output {
crate::compatibility_check_once();
match self {
CowStr::Borrowed(s) => CowStr::Owned((*s).into()),
CowStr::Owned(s) => CowStr::Owned(s),
@@ -232,7 +219,6 @@ mod serde_impls {
where
S: serde::Serializer,
{
crate::compatibility_check_once();
serializer.serialize_str(self)
}
}
@@ -243,8 +229,6 @@ mod serde_impls {
where
D: serde::Deserializer<'de>,
{
crate::compatibility_check_once();

struct CowStrVisitor;

impl<'de> serde::de::Visitor<'de> for CowStrVisitor {
@@ -293,15 +277,13 @@ mod rusqlite_impls {
impl ToSql for CowStr<'_> {
#[inline]
fn to_sql(&self) -> RusqliteResult<rusqlite::types::ToSqlOutput<'_>> {
crate::compatibility_check_once();
Ok(rusqlite::types::ToSqlOutput::Borrowed(self.as_ref().into()))
}
}

impl FromSql for CowStr<'_> {
#[inline]
fn column_result(value: rusqlite::types::ValueRef<'_>) -> Result<Self, FromSqlError> {
crate::compatibility_check_once();
match value {
rusqlite::types::ValueRef::Text(s) => Ok(CowStr::from_utf8(s)
.map_err(|e| FromSqlError::Other(Box::new(e)))?
4 changes: 0 additions & 4 deletions merde_core/src/lib.rs
Original file line number Diff line number Diff line change
@@ -54,7 +54,3 @@ pub use deserialize::DynDeserializerExt;
pub use deserialize::FieldSlot;

pub mod time;

rubicon::compatibility_check! {
("merde_core_pkg_version", env!("CARGO_PKG_VERSION")),
}

0 comments on commit 7fd1cb6

Please sign in to comment.