質問編集履歴

1

修正

2022/12/06 12:00

投稿

izmrui2020
izmrui2020

スコア0

test CHANGED
File without changes
test CHANGED
@@ -46,7 +46,7 @@
46
46
 
47
47
  impl Ord for WrapEntry {
48
48
  fn cmp(&self, other: &Self) -> Ordering {
49
- if self.0.id == self.0.id {
49
+ if self.0.id == other.0.id {
50
50
  Ordering::Equal
51
51
  } else {
52
52
  match self.0.value.cmp(&other.0.value) {
@@ -98,6 +98,7 @@
98
98
  println!("{:?}", set.replace(a3));
99
99
  println!("{:?}", set.replace(b1));
100
100
 
101
+ println!("xxxxxxxxxxxxxxxxxx");
101
102
 
102
103
  for i in set.iter() {
103
104
  println!("{:?}", i);
@@ -112,15 +113,20 @@
112
113
  ```
113
114
  Start
114
115
  None
116
+ None
117
+ None
118
+ None
115
119
  Some(WrapEntry(Entry { id: "aaa", value: BigDecimal("100") }))
116
- Some(WrapEntry(Entry { id: "bbb", value: BigDecimal("106") }))
117
120
  Some(WrapEntry(Entry { id: "ccc", value: BigDecimal("100") }))
121
+ None
122
+ Some(WrapEntry(Entry { id: "aaa", value: BigDecimal("103") }))
118
123
  Some(WrapEntry(Entry { id: "bbb", value: BigDecimal("94") }))
119
- Some(WrapEntry(Entry { id: "aaa", value: BigDecimal("103") }))
124
+ xxxxxxxxxxxxxxxxxxxxx
120
- Some(WrapEntry(Entry { id: "ccc", value: BigDecimal("110") }))
121
- Some(WrapEntry(Entry { id: "ccc", value: BigDecimal("84") }))
125
+ WrapEntry(Entry { id: "ccc", value: BigDecimal("84") })
122
- Some(WrapEntry(Entry { id: "aaa", value: BigDecimal("97") }))
123
126
  WrapEntry(Entry { id: "bbb", value: BigDecimal("100") })
127
+ WrapEntry(Entry { id: "aaa", value: BigDecimal("97") })
128
+ WrapEntry(Entry { id: "ccc", value: BigDecimal("110") })
129
+ WrapEntry(Entry { id: "bbb", value: BigDecimal("106") })
124
130
  ```
125
131
 
126
132
  ### 試したこと