Skip to content

Commit 3543753

Browse files
committed
examples: tidy
1 parent 6015314 commit 3543753

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

examples/samples/elle/serialization.cc

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace elle
2323
// 0.1.0
2424
// + title (std::string)
2525
// + artist (std::string)
26-
// + id (elle::UUID°
26+
// + id (elle::UUID)
2727
// + unwanted (int)
2828
// 0.2.0:
2929
// + release_date (boost::posix_time::ptime)
@@ -34,15 +34,14 @@ namespace elle
3434
struct Record
3535
: public elle::Printable
3636
{
37-
Record(std::string const& title,
38-
std::string const& artist,
37+
Record(std::string title,
38+
std::string artist,
3939
boost::posix_time::ptime const& release_date)
40-
: _title(title)
41-
, _artist(artist)
40+
: _title(std::move(title))
41+
, _artist(std::move(artist))
4242
, _id(elle::UUID::random())
4343
, _release_date(release_date)
44-
{
45-
}
44+
{}
4645

4746
/// Add a deserialization constructor.
4847
Record(elle::serialization::SerializerIn& in,
@@ -109,8 +108,8 @@ main()
109108
auto record
110109
= Record("Sandstorm", "Darube",
111110
boost::posix_time::time_from_string("1999-11-26 00:00:00.000"));
112-
record.tags().push_back("Dance");
113-
record.tags().push_back("Electronic");
111+
record.tags().emplace_back("Dance");
112+
record.tags().emplace_back("Electronic");
114113
// Serialize Record as in version 0.1.0, where release_date & tags didn't
115114
// exist yet.
116115
{

0 commit comments

Comments
 (0)