Skip to content

Commit

Permalink
clippy: fix v1.78.0 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcnamara committed May 28, 2024
1 parent a1d967c commit ae406b3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/chart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8184,7 +8184,7 @@ impl ChartTitle {
// If the name didn't convert to a populated range then it probably just
// a simple string title.
if !self.range.has_data() {
self.name = self.range.range_string.clone();
self.name.clone_from(&self.range.range_string);
}

self
Expand Down
2 changes: 1 addition & 1 deletion src/drawing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ impl Drawing {
let mut name = format!("{name} {index}");

if !drawing_info.name.is_empty() {
name = drawing_info.name.clone();
name.clone_from(&drawing_info.name);
}

let mut attributes = vec![("id", id.to_string()), ("name", name)];
Expand Down
6 changes: 3 additions & 3 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,14 @@ pub enum XlsxError {
/// or to convert other Error types to.
CustomError(String),

/// Wrapper for a variety of [std::io::Error] errors such as file
/// Wrapper for a variety of [`std::io::Error`] errors such as file
/// permissions when writing the xlsx file to disk. This can be caused by an
/// non-existent parent directory or, commonly on Windows, if the file is
/// already open in Excel.
IoError(std::io::Error),

/// Wrapper for a variety of [zip::result::ZipError] errors from
/// [zip::ZipWriter]. These relate to errors arising from creating
/// Wrapper for a variety of [`zip::result::ZipError`] errors from
/// [`zip::ZipWriter`]. These relate to errors arising from creating
/// the xlsx file zip container.
ZipError(zip::result::ZipError),

Expand Down
2 changes: 1 addition & 1 deletion src/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1174,7 +1174,7 @@ impl Table {
// Set the column header names,
for (index, column) in self.columns.iter_mut().enumerate() {
if column.name.is_empty() {
column.name = default_headers[index].clone();
column.name.clone_from(&default_headers[index]);
}

if seen_column_names.contains(&column.name.to_lowercase()) {
Expand Down
6 changes: 3 additions & 3 deletions src/worksheet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15093,7 +15093,7 @@ impl Hyperlink {
self.link_type = HyperlinkType::Url;

if self.text.is_empty() {
self.text = self.url.clone();
self.text.clone_from(&self.url);
}

// Split the url into url + #anchor if that exists.
Expand All @@ -15115,7 +15115,7 @@ impl Hyperlink {
self.location = self.url.replacen("internal:", "", 1);

if self.text.is_empty() {
self.text = self.location.clone();
self.text.clone_from(&self.location);
}
} else if self.url.starts_with("file://") {
// Handle links to other files or cells in other Excel files.
Expand All @@ -15125,7 +15125,7 @@ impl Hyperlink {

// Links to local files aren't prefixed with file:///.
if !REMOTE_FILE.is_match(&bare_link) {
self.url = bare_link.clone();
self.url.clone_from(&bare_link);
}

if self.text.is_empty() {
Expand Down

0 comments on commit ae406b3

Please sign in to comment.