Skip to content

Commit 4b58a3d

Browse files
ZapAntoncoriolinus
authored andcommitted
roman-numerals: Added template to the stub file (#579)
* roman-numerals: Added template to the stub file * roman-numerals: Replaced i32 type with u32 type in 'From' trait template implementation
1 parent b10c4fc commit 4b58a3d

File tree

1 file changed

+14
-0
lines changed
  • exercises/roman-numerals/src

1 file changed

+14
-0
lines changed

exercises/roman-numerals/src/lib.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,15 @@
1+
use std::fmt::{Display, Formatter, Result};
12

3+
pub struct Roman;
4+
5+
impl Display for Roman {
6+
fn fmt(&self, _f: &mut Formatter) -> Result {
7+
unimplemented!("Return a roman-numeral string representation of the Roman object");
8+
}
9+
}
10+
11+
impl From<u32> for Roman {
12+
fn from(num: u32) -> Self {
13+
unimplemented!("Construct a Roman object from the '{}' number", num);
14+
}
15+
}

0 commit comments

Comments
 (0)