Skip to content

Commit

Permalink
refactor(object): replace as_ref().cloned() with clone()
Browse files Browse the repository at this point in the history
- Simplify code by using clone() directly instead of as_ref().cloned()
- Improve readability and conciseness in the Object implementation
  • Loading branch information
ShenMian committed Jan 4, 2025
1 parent ad9fd4e commit 87c2952
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,11 @@ impl Object {
Self {
name: elements
.object_name
.as_ref()
.cloned()
.clone()
.unwrap_or("Unknown".to_string()),
cospar_id: elements
.international_designator
.as_ref()
.cloned()
.clone()
.unwrap_or("Unknown".to_string()),
norad_id: elements.norad_id,
epoch: DateTime::from_naive_utc_and_offset(elements.datetime, Utc),
Expand Down

0 comments on commit 87c2952

Please sign in to comment.