Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/types/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ impl Key {
}

/// Read the key as a lossy UTF8 string with `String::from_utf8_lossy`.
pub fn as_str_lossy(&self) -> Cow<str> {
pub fn as_str_lossy(&self) -> Cow<'_, str> {
String::from_utf8_lossy(&self.key)
}

Expand Down Expand Up @@ -976,7 +976,7 @@ impl Value {
/// Read the inner value as a string slice.
///
/// Null is returned as `"nil"` and scalar values are cast to a string.
pub fn as_str(&self) -> Option<Cow<str>> {
pub fn as_str(&self) -> Option<Cow<'_, str>> {
let s: Cow<str> = match *self {
Value::Double(ref f) => Cow::Owned(f.to_string()),
Value::Boolean(ref b) => Cow::Owned(b.to_string()),
Expand All @@ -995,7 +995,7 @@ impl Value {
}

/// Read the inner value as a string, using `String::from_utf8_lossy` on byte slices.
pub fn as_str_lossy(&self) -> Option<Cow<str>> {
pub fn as_str_lossy(&self) -> Option<Cow<'_, str>> {
let s: Cow<str> = match *self {
Value::Boolean(ref b) => Cow::Owned(b.to_string()),
Value::Double(ref f) => Cow::Owned(f.to_string()),
Expand Down
10 changes: 5 additions & 5 deletions src/types/scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub trait Scanner {
type Page;

/// Read the cursor returned from the last scan operation.
fn cursor(&self) -> Option<Cow<str>>;
fn cursor(&self) -> Option<Cow<'_, str>>;

/// Whether the scan call will continue returning results. If `false` this will be the last result set
/// returned on the stream.
Expand Down Expand Up @@ -110,7 +110,7 @@ impl Drop for ScanResult {
impl Scanner for ScanResult {
type Page = Vec<Key>;

fn cursor(&self) -> Option<Cow<str>> {
fn cursor(&self) -> Option<Cow<'_, str>> {
if let Some(ref state) = self.scan_state {
state.args[state.cursor_idx].as_str()
} else {
Expand Down Expand Up @@ -177,7 +177,7 @@ impl Drop for HScanResult {
impl Scanner for HScanResult {
type Page = Map;

fn cursor(&self) -> Option<Cow<str>> {
fn cursor(&self) -> Option<Cow<'_, str>> {
if let Some(ref state) = self.scan_state {
state.args[state.cursor_idx].as_str()
} else {
Expand Down Expand Up @@ -244,7 +244,7 @@ impl Drop for SScanResult {
impl Scanner for SScanResult {
type Page = Vec<Value>;

fn cursor(&self) -> Option<Cow<str>> {
fn cursor(&self) -> Option<Cow<'_, str>> {
if let Some(ref state) = self.scan_state {
state.args[state.cursor_idx].as_str()
} else {
Expand Down Expand Up @@ -311,7 +311,7 @@ impl Drop for ZScanResult {
impl Scanner for ZScanResult {
type Page = Vec<(Value, f64)>;

fn cursor(&self) -> Option<Cow<str>> {
fn cursor(&self) -> Option<Cow<'_, str>> {
if let Some(ref state) = self.scan_state {
state.args[state.cursor_idx].as_str()
} else {
Expand Down