Skip to content

Commit

Permalink
Remove the old_rust feature
Browse files Browse the repository at this point in the history
This feature is no longer needed since we're droppin 1.41 support anyway
and if it ever needs to be reintroduced using a build script is better.
  • Loading branch information
Kixunil committed Jul 13, 2024
1 parent 03d1c70 commit 2e52d6a
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 33 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ spec = "config_spec.toml"

[features]
default = ["debug_logs", "systemd"]
old_rust = []
debug_logs = ["slog/max_level_debug"]
systemd = ["systemd_socket/enable_systemd"]

Expand Down
2 changes: 0 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![cfg_attr(feature = "old_rust", allow(unstable_name_collisions))]

#[macro_use]
extern crate slog;

Expand Down
3 changes: 0 additions & 3 deletions src/rpc_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer};
use crate::client::RpcMethod;
use crate::util::{Either, HexBytes};

#[cfg(feature = "old_rust")]
use crate::util::old_rust::StrCompat;

#[derive(Debug)]
pub struct GetBlock;
#[derive(Debug, Deserialize, Serialize)]
Expand Down
3 changes: 0 additions & 3 deletions src/users.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ use crate::rpc_methods::{
};
use crate::state::State;

#[cfg(feature = "old_rust")]
use crate::util::old_rust::StrCompat;

pub use password::Password;

pub mod input {
Expand Down
24 changes: 0 additions & 24 deletions src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,30 +58,6 @@ pub trait ApplyMut {
}
impl<T> ApplyMut for T {}

#[cfg(feature = "old_rust")]
pub mod old_rust {
pub trait StrCompat {
fn strip_prefix<'a>(&'a self, prefix: &str) -> Option<&'a str>;
fn strip_suffix<'a>(&'a self, suffix: &str) -> Option<&'a str>;
}
impl StrCompat for str {
fn strip_prefix<'a>(&'a self, prefix: &str) -> Option<&'a str> {
if let Some(s) = self.matches(prefix).next() {
Some(&self[s.len()..])
} else {
None
}
}
fn strip_suffix<'a>(&'a self, suffix: &str) -> Option<&'a str> {
if let Some(s) = self.rmatches(suffix).next() {
Some(&self[..(self.len() - s.len())])
} else {
None
}
}
}
}

#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
#[serde(untagged)]
pub enum Either<Left, Right> {
Expand Down

0 comments on commit 2e52d6a

Please sign in to comment.