mirror of
https://github.com/mimblewimble/grin.git
synced 2025-02-08 12:21:09 +03:00
Fix the build warning of deprecated trim_right_matches (#2662)
This commit is contained in:
parent
699d85a799
commit
608973c498
3 changed files with 6 additions and 6 deletions
|
@ -79,7 +79,7 @@ impl Handler for PeerHandler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fn post(&self, req: Request<Body>) -> ResponseFuture {
|
fn post(&self, req: Request<Body>) -> ResponseFuture {
|
||||||
let mut path_elems = req.uri().path().trim_right_matches('/').rsplit('/');
|
let mut path_elems = req.uri().path().trim_end_matches('/').rsplit('/');
|
||||||
let command = match path_elems.next() {
|
let command = match path_elems.next() {
|
||||||
None => return response(StatusCode::BAD_REQUEST, "invalid url"),
|
None => return response(StatusCode::BAD_REQUEST, "invalid url"),
|
||||||
Some(c) => c,
|
Some(c) => c,
|
||||||
|
|
|
@ -95,9 +95,9 @@ pub fn amount_to_hr_string(amount: u64, truncate: bool) -> String {
|
||||||
if truncate {
|
if truncate {
|
||||||
let nzeros = hr.chars().rev().take_while(|x| x == &'0').count();
|
let nzeros = hr.chars().rev().take_while(|x| x == &'0').count();
|
||||||
if nzeros < *WIDTH {
|
if nzeros < *WIDTH {
|
||||||
return hr.trim_right_matches('0').to_string();
|
return hr.trim_end_matches('0').to_string();
|
||||||
} else {
|
} else {
|
||||||
return format!("{}0", hr.trim_right_matches('0'));
|
return format!("{}0", hr.trim_end_matches('0'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hr
|
hr
|
||||||
|
|
|
@ -300,7 +300,7 @@ where
|
||||||
match req
|
match req
|
||||||
.uri()
|
.uri()
|
||||||
.path()
|
.path()
|
||||||
.trim_right_matches("/")
|
.trim_end_matches("/")
|
||||||
.rsplit("/")
|
.rsplit("/")
|
||||||
.next()
|
.next()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
|
@ -553,7 +553,7 @@ where
|
||||||
match req
|
match req
|
||||||
.uri()
|
.uri()
|
||||||
.path()
|
.path()
|
||||||
.trim_right_matches("/")
|
.trim_end_matches("/")
|
||||||
.rsplit("/")
|
.rsplit("/")
|
||||||
.next()
|
.next()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
|
@ -684,7 +684,7 @@ where
|
||||||
match req
|
match req
|
||||||
.uri()
|
.uri()
|
||||||
.path()
|
.path()
|
||||||
.trim_right_matches("/")
|
.trim_end_matches("/")
|
||||||
.rsplit("/")
|
.rsplit("/")
|
||||||
.next()
|
.next()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
|
|
Loading…
Reference in a new issue