Skip to content

Commit

Permalink
Remove prime trait (#612)
Browse files Browse the repository at this point in the history
  • Loading branch information
casey authored Oct 4, 2022
1 parent 88ced59 commit 5c83e42
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 27 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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ http = "0.2.6"
lazy_static = "1.4.0"
log = "0.4.14"
mime_guess = "2.0.4"
primes = "0.3.0"
rayon = "1.5.1"
redb = "0.7.0"
regex = "1.6.0"
Expand Down
4 changes: 0 additions & 4 deletions src/ordinal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ impl Ordinal {
self.into()
}

pub(crate) fn prime(self) -> bool {
primes::is_prime(self.0)
}

pub(crate) fn name(self) -> String {
let mut x = Self::SUPPLY - self.0;
let mut name = String::new();
Expand Down
14 changes: 0 additions & 14 deletions src/subcommand/server/templates/ordinal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ mod tests {
<dt>block</dt><dd>0</dd>
<dt>offset</dt><dd>0</dd>
<dt>rarity</dt><dd><span class=mythic>mythic</span></dd>
<dt>prime</dt><dd>false</dd>
<dt>time</dt><dd>1970-01-01 00:00:00</dd>
</dl>
<a>prev</a>
Expand All @@ -47,18 +46,6 @@ mod tests {
);
}

#[test]
fn two_is_prime() {
assert_regex_match!(
OrdinalHtml {
ordinal: Ordinal(2),
blocktime: Blocktime::Confirmed(0),
}
.to_string(),
".*<dt>prime</dt><dd>true</dd>.*",
);
}

#[test]
fn ordinal_next_and_previous() {
assert_eq!(
Expand All @@ -80,7 +67,6 @@ mod tests {
<dt>block</dt><dd>0</dd>
<dt>offset</dt><dd>1</dd>
<dt>rarity</dt><dd><span class=common>common</span></dd>
<dt>prime</dt><dd>false</dd>
<dt>time</dt><dd>1970-01-01 00:00:00</dd>
</dl>
<a href=/ordinal/0>prev</a>
Expand Down
1 change: 0 additions & 1 deletion templates/ordinal.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ <h1>Ordinal {{ self.ordinal.n() }}</h1>
<dt>block</dt><dd>{{ self.ordinal.height() }}</dd>
<dt>offset</dt><dd>{{ self.ordinal.third() }}</dd>
<dt>rarity</dt><dd><span class={{self.ordinal.rarity()}}>{{ self.ordinal.rarity() }}</span></dd>
<dt>prime</dt><dd>{{ self.ordinal.prime() }}</dd>
<dt>time</dt><dd>{{ self.blocktime }}</dd>
</dl>
%% if self.ordinal.n() > 0 {
Expand Down

0 comments on commit 5c83e42

Please sign in to comment.